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: Advertisement service data

Part Number: CC2640R2F

Hello everyone;

I need to add advertisement service data in my project in order to identify which model of my product I am connecting in before to perform a connection. I think two bytes in advertisement service data is sufficient.

My project uses CC2640R2F with stack 4.x of bluetooth.

Please, could anyone help me?

  • I can use GAP_ADTYPE_SERVICE_DATA_32BIT or GAP_ADTYPE_SERVICE_DATA_128BIT in advertData[].


    Are there some example?

  • Hi,

    I highly recommend referencing the Scanning & Advertising SimpleLink Academy lab. This module provides information on how to set up scanning and advertising. Advertising Task 2 specifically shows how to change advertising data in a ble4 example.

    Best Regards,

    Jan

  • Ok, I know how to change the advertising and response data. My doubt is specifically about GAP_ADTYPE_SERVICE_DATA_*

    The module from SimpleLink Academy lab not have any mention of GAP_ADTYPE_SERVICE_DATA_* and I unable to find samples related to that.

    static uint8_t advertData[] =
    {
    
      // ... another stuffs
    
      0x05,
      GAP_ADTYPE_SERVICE_DATA_32BIT,
      LO_UINT16(SIMPLEPROFILE_SERV_UUID),
      HI_UINT16(SIMPLEPROFILE_SERV_UUID),
      0x2,
      0x3,
    };

    My attempt is to add the code above but I cant capture the service data in android application.

  • I am able to get the service data with this code

    static uint8_t advertData[] =
    {
    
    // ... another stuffs
    
    0x05,
    GAP_ADTYPE_SERVICE_DATA,
    LO_UINT16(SIMPLEPROFILE_SERV_UUID),
    HI_UINT16(SIMPLEPROFILE_SERV_UUID),
    0x2,
    0x3,
    };