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.

CC2640R2F: Advertising payload data 255 bytes

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2650

Tool/software:

Hi,

I have a question about Bluetooth advertising of CC2640R2F

1.Can you explain about Bluetooth advertising legacy and Extension in Payload(Advertising Channel PDU)?

AdvData(0 - 254 bytes)

2.Is the picture above correct?

3.picture below (AdvA 6 octets) is MAC Address of Bluetooth or not?

Thank,

Vasu Khwanyuen

  • Hello Vasu,

    Thanks for reaching out.

    Bluetooth 5 introduced Extended Advertising as one of its new features. Regarding the payload size, the amount of advertising data that can be sent over the air has been extended from 31 bytes to 1650 bytes. However, this makes reference to the total amount of Host Advertising Data before fragmentation (which should not exceed 1650 octets). Therefore, if the amount of advertising or scan response data that is send in an extended advertising or scanning PDU plus the Extended Header Length, AdvMode, and Extended Header exceed the maximum Advertising Channel PDU payload of 255 octets, then the Link Layer will fragment the Host advertising data. For more information I would recommend to look at the Host Advertising Data section ([Vol 6], Part B, Section 2.3.4.9) of the Bluetooth Core Specifications Version 5.2.

    Please lets continue the discussion about Advertising Extension on this current thread. I see another similar question has been opened here (https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1410304/cc2640r2f-advertising-extension-not-254-bytes). Thanks!

    BR,

    David.

  • Thanks for answer,

    Let me explain it clearly point by point.

    1.From the answer you gave, 

    advertising extension is extension from advertising legacy 31 bytes. So, AdvData 255 bytes is advertising legacy with Extension (AdvA 6 bytes + Legacy 31 bytes + Extension 218 bytes = 255 bytes) In case advertising up to 255 bytes

    I understand correct right?

    2.AdvA 6 bytes is Mac Address of Bluetooth or not?

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    1. Yes, the payload (AdvData) is in total 255 octets.
    2. Yes, the first 6 bytes represent the advertiser’s BLE address (AdvA) and the rest is the advertisement data (AdvData). 

    BR,

    David.

  • Thank David,

    If I want to reduce the size of Extended Header
    Where can I fix it? Do you have any examples?

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    The length of the extended Header depends on the type of peripheral role is selected (directed adv, in-directed adv, connectable, etc). This is handled by the stack and it is not configurable on an application level. That being said, it is rarely the case that the extended header will have the max value (usually around 6 to 20 bytes).

    BR,

    David.

  • Thank David,

    I just happened to try increasing the size of extensions advertising is 229 bytes. Result can advertising.

    So, I have a question about the question that I answered last time and you confirmed the answer.

    Please look in picture below

    1.Why payload (advData) if sum with legacy advertising 31 bytes and address data 6 bytes it more than 255 bytes?

    2.Or advData legacy not sum with extension in payload 255 bytes. So, pattern of advData is picture below or not?

    Please look in picture

    From www.bluetooth.com/.../

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    Apologies, maybe I generated a confusion by mentioning "payload (AdvData)". The AdvData can go up to 255, which I am assuming you have increased to 229. May I ask for the source of this image? I think it can help me better understand where the question is coming.

    Thanks.

    David.

  • Hi David,

    Please follow link below

    https://www.bluetooth.com/blog/exploring-bluetooth5-whats-new-in-advertising/

    and Bluetooth spec on section 2.3.4. Common Extended Advertising Payload Format

    www.bluetooth.com/.../link-layer-specification.html

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    I think our Radio Control Layer documentation can help clarify this properly. You can find it inside the SDK folder in: <SDK>/docs/rcl/html/advertiser_handler.html.

    The Extended Adv Payload can be as short as 1 byte (only using Extended Header - 6 bits file and AdvMode - 2 bits) if the Extended Header is 0 and the AdvData is 0. And it can go as high as 1 byte (from Extended Header and AdvMode) + Extended Header (around 6 - 25 bytes) + AdvData (defined as the rest of the payload = 255 - 1 - 25 approx).

    Hope this helps.

    BR,

    David

  • Hi David,

    Thank for answer. It help me for understand my issues.

    I supspect single advertising and Multi advertising. How is it different?

    And now I use mobile for see data sniffer. It can get data legacy only but extension can't get it.

    Do you have way for get data extension?

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    Have you configured your secondary PHY? Try setting it to 2M PHY.

    BR,

    David.

  • Hi David,

    Now I use configured default from TI

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    Coded PHYs are not supported by the phones as far as I know. I would suggest to modify the secondary PHY (the one that refers to _LONG_RANGE_) to 2 M PHY. On the other hand, you could use a Bluetooth LE sniffer to see the coded phy air logs.

    BR,

    David

  • Hi David,

    After try set primary and secondary physical follow recommend. I can detect extended advertising.

    Please help me confirm data extension header 25 bytes

     (from Extended Header and AdvMode) + Extended Header (around 6 - 25 bytes) + AdvData (defined as the rest of the payload = 255 - 1 - 25 approx).

      

    If Bluetooth LE sniffer i found problem. I can't use this program for check advertising.

    Please follow link below

    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1411741/cc2640r2f-smart-rf-sniffer-agent-can-not-detect-devices/5413369?tisearch=e2e-sitesearch&keymatch=%2520user%253A494327#5413369

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    Glad to hear you can detect extended advertising. Are you able to use the CC2650 or the CC26X2R1 to capture the packets?

    BR,

    David.

  • Hi David,

    I have board CC2640R2F only

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    I think we would need a Bluetooth sniffer to confirm with the air logs. Another way is to set the max amount of data in the AdvData field and then calculate the rest: 255 - 1 - size(AdvData) = Extended Header.

    If you look into the previous documentation: <SDK>/docs/rcl/html/advertiser_handler.html, you would see that this values are defined by ADV_EXT_HDR_LEN  and AUX_ADV_HDR_LEN in the setAdvExtBuffer() and setAuxAdvBuffer() functions respectively, however these are only examples of functions and definitions. In reality, the stack will define/calculate this values and share them with the radio control layer.

    BR,

    David.

  • Hi David,

    Thanks for recommend.

    I think if project example simple serial socket server default code not modify anything. You should know about packet data Extended Header.

    So, Can you tell me about packet data sniffer (Extended Header) of project example?

    And from you said

    If you look into the previous documentation: <SDK>/docs/rcl/html/advertiser_handler.html,

    I'm not found link from SDK

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    To make sure we have the same project configuration, such as adv configuration and SDK version, would you mind attaching here the .hex file of the simple serial socket you are working on so I can take a look with the sniffer? This only if you do not have any confidential/proprietary information that cannot be disclosed over the forum in this project of course.

    BR,

    David.

  • Hi David,

    Default code (Simple serial socket server)

    run with SDK 3.30.00.20

    Please try simple code. I need to see header of extended advertising

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    Okay, please allow me until tomorrow to test this. However, if you haven't modified the project, how is it working with extended advertising?

    BR,

    David.

  • Hi David,

    Extended advertising show same legacy. I focus in extended header I need to know.

    My project I not modified the project about extended header. I change advertising data only.

    So, I will referrent from simple project about extended header.

    You can follow code simple project in link below

    https://github.com/TexasInstruments/ble_examples/blob/simplelink_cc2640r2_sdk-3.30/examples/rtos/CC2640R2_LAUNCHXL/ble5apps/simple_serial_socket_server/src/app/simple_serial_socket_server.c

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    I had issue building the example with the SDK you are using, probably something on my PC setup that I am taking a look. However I took a look on other examples that should behave similarly with respect to Advertisement Extension. You can see here for instance that if the Adv mode is configured for Connectable - Non Scannable, then the Extended Header Length is 6 bytes, while if the Adv mode is configure to Non Connectable / Non Scannable, then the Extended Header Length is 12 bytes. I don't expect a difference with the example you mentioned, but if there is any difference in configuration there might be. If you send me the .hex file you generate after building the project, I could run a quick test for a sanity check.

    BR,

    David.

  • Hi David,

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    Please see attached the log. The payload is set to 239 bytes while the Extended Header is set to 6 bytes.

    Please see the raw data below:

    1. Adv Mode -> 4
    2. Extended Header Length -> 9
    3. Extended Header -> 09 C5 3E A0 0E 6C 54 E2 08
    4. Adv Data -> From E4 to last FF.
    5. CRC -> 68 5C 84.

    Hope this helps.

    David.

  • Hi David,

    Data PDU not full to 255 bytes. In Adv Data if increase data 1 byte, I can't see extended advertising in Mobile app (NRF Connect).

    Reason, i can't see extended advertising data from mobile app can not check or Bluetooth can't set Adv Data more than 229 bytes(payload 239bytes)? 

    And from you said 

    Can I see code about extended header?

    If Yes, Please point position code of extended header.

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    Could you please share with me how in the code you are increasing the Manufacturer Specific Data? It is here that you are not able to add an extra 0xFF byte without the adv not working correctly right?

    BR,

    David.

  • Hi David,

    I add advData follow picture below

    Code advData add in set#2 long range

    // Use long range params to create long range set #2
            GapAdv_params_t advParamLongRange = GAPADV_PARAMS_AE_LONG_RANGE_CONN;

            // Create Advertisement set #2 and assign handle
            status = GapAdv_create(&SimpleSerialSocketServer_advCB, &advParamLongRange,
                                   &advHandleLongRange);
            SimpleSerialSocketServer_ASSERT(status == SUCCESS);

            // Load advertising data for set #2 that is statically allocated by the app
            status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_ADV,
                                         sizeof(advertData), advertData);
            SimpleSerialSocketServer_ASSERT(status == SUCCESS);

            // Set event mask for set #2
            status = GapAdv_setEventMask(advHandleLongRange,
                                         GAP_ADV_EVT_MASK_START_AFTER_ENABLE |
                                         GAP_ADV_EVT_MASK_END_AFTER_DISABLE |
                                         GAP_ADV_EVT_MASK_SET_TERMINATED);

            // Enable long range advertising for set #2
            status = GapAdv_enable(advHandleLongRange, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
            SimpleSerialSocketServer_ASSERT(status == SUCCESS);

    Best Regards,

    Vasu Khwanyuen

  • Hi

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    Apologies, very busy week.

    Could you please share your "advertData"? I do not understand the Advertising data (230 bytes) structure from the picture.

    I will test increasing the payload data on my own project as well.

    BR,

    David.

  • Hi David,

    static uint8_t advertData[] =
    {
      0xE5,
      GAP_ADTYPE_MANUFACTURER_SPECIFIC,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
    };

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    I have increased the advertisement data size to 245 and I see no issues in transmitting the packet and recognizing it with the Bluetooth sniffer. I am using a Connectable advertising mode.

    extern uint8_t advData1[245];
    
    uint8_t advData1[] =
    {
      0x02,
      GAP_ADTYPE_FLAGS,
      GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED | GAP_ADTYPE_FLAGS_GENERAL,
    
      0xE5,
      GAP_ADTYPE_MANUFACTURER_SPECIFIC,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
    };

    BR,

    David.

  • Hi David,

    I just got a new board CC26X2R1.

    Can you recommend your sniffer follow your  below

    How to use for search Link-Layer Packet?

    I was post ask Bluetooth forum in e2e.ti. I got the answer recommend manual general but it no detail to need.

    Best Regards,

    Vasu Khwanyuen

  • Hello Vasu,

    May I ask if you are asking how to search with the sniffer tool? This depends on the sniffer you have.

    BR,

    David.