This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/SIMPLELINK-CC2640R2-SDK: why extended advertise didn't work in sample project?

Part Number: SIMPLELINK-CC2640R2-SDK

Tool/software: TI-RTOS

Hi

I'm working with ble5 Central and peripheral project

I change advertData[] more then 35 byte for test.

and I scan it using central project. and using mobile phone.

but It's seem to not work... this advertdata can't find...

when I set advetData[] length 25 byte it work!!

I found that setting code for extended advertise data exsist in peripheral project .

here is what I set advertData and not modified setting code.

plz let me know what I didn't do....

------------ADVERTDATA------------------

-----------Default Setting data -------------


  • Hi,

    The advertData array is used both for legacy advertising and advertising extension, therefore when you increase the advertData to more than 31 bytes, the program will not run since it violates the spec for legacy advertising limits.

    You need to create another array to have more than 31 bytes for the adv extension feature.
  • thank you for reply.
    but I remove all line of "advHandleLegacy" written.
    so there are only one handle that use advertData named advHandleLongRange.
    but when I remove "advHandleLegacy" I can't find my device... advHandleLongRange alive but why advert data is not visible?? even data length is 20byte... not extended mode..
  • You don't need to remove all the legacy ones. All you need to do is to add one more array and make sure the advHandleLongRange is using the new adv data array which have more than 31 bytes.

    How do you view adverting data in LRM? Your phone might not support BT5 spec. 

    I would recommend you to take a look at our SimpleLink Academy : Bluetooth Low Energy Scanning and Advertising

    When you are advertising using long range mode, then it's advertising extension. Legacy advertising can only be used on 1M PHY. When enable LRM doing advertising, there is no advertising data in the normal advertising channels. The packet in advertising channels contains only a pointer to where the adv data is going to be sent from which data channel. 

  • All you need to do is to add one more array and make sure the advHandleLongRange is using the new adv data array which have more than 31 bytes.

    thank you.

    But it's seem to be not work...  I create buffer sized 33byte.

    I tested in two ways.

    1. using my phone.. (iPhone 8+ - ble5.0, using TI SensorTag application)

     - extended advertisement data is not shown .. 

    2. Using two of device, one Simple_peripheral project, other one is Central project.

     - extended advertisement data is not shown .. 

    -------------------------------------------------------------------------------------------------------------

    // Advertisement data
    static uint8_t advertData[] =
    {
      0x02,   // length of this data
      GAP_ADTYPE_FLAGS,
      DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
      // service UUID, to notify central devices what services are included
      // in this peripheral
      0x03,   // length of this data
      GAP_ADTYPE_16BIT_MORE,      // some of the UUID's, but not all
      LO_UINT16(SIMPLEPROFILE_SERV_UUID),
      HI_UINT16(SIMPLEPROFILE_SERV_UUID),
        20,
        GAP_ADTYPE_MANUFACTURER_SPECIFIC,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19,
    };

    static uint8_t advertDataLong[] =
    {
      0x02,   // length of this data
      GAP_ADTYPE_FLAGS,
      DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
      // service UUID, to notify central devices what services are included
      // in this peripheral
      0x03,   // length of this data
      GAP_ADTYPE_16BIT_MORE,      // some of the UUID's, but not all
      LO_UINT16(SIMPLEPROFILE_SERV_UUID),
      HI_UINT16(SIMPLEPROFILE_SERV_UUID),
        26,
        GAP_ADTYPE_MANUFACTURER_SPECIFIC,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19,
        20,
        21,
        22,
        23,
        24,
        25
    };
    ------------------------------------------------------------------------------------
    initialize code

  • this is result of scan advertdata..

    there can't scan extended but normal legacy advertisement data...

  • Oh I have set coded when read advertising data!
    thank you!!
  • Did you solve your problem? I am not sure what you meant here.