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.

LAUNCHXL-CC26X2R1: How can I receive the scan Response data from the advertisement packet?

Part Number: LAUNCHXL-CC26X2R1


Hi,

I have one peripheral device and another one multi role(peripheral and central).

In peripheral device, I have updated the advertisement packet.

For example:

static uint8_t scanRspData[] =
{
11,                                                                                             // length of this data
GAP_ADTYPE_LOCAL_NAME_COMPLETE,
'M', 'u', 'l', 't', 'i', ' ', 'R', 'o', 'l', 'e',                                                 //Device name

5,                                                                                               // length of this data
GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
LO_UINT16(DEFAULT_DESIRED_MIN_CONN_INTERVAL), // 100ms
HI_UINT16(DEFAULT_DESIRED_MIN_CONN_INTERVAL),
LO_UINT16(DEFAULT_DESIRED_MAX_CONN_INTERVAL), // 1s
HI_UINT16(DEFAULT_DESIRED_MAX_CONN_INTERVAL),

// Tx power level
2, // length of this data
GAP_ADTYPE_POWER_LEVEL,
0 // 0dBm
};

static uint8_t advertData[] =
{
0x02,                                                                                              // length of this data
GAP_ADTYPE_FLAGS,
DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

0x03,                                                                                             // length of this data
GAP_ADTYPE_16BIT_MORE, 
LO_UINT16(SIMPLEPROFILE_SERV_UUID),
HI_UINT16(SIMPLEPROFILE_SERV_UUID)
};

 

In Multi role, I want to receive the device name from the peripheral device which present in the scan response of the advertising packet and need to send the device name "multi role" over UART.

I have tried with these steps:

For example:

case MR_EVT_ADV_REPORT:
{
         GapScan_Evt_AdvRpt_t* pAdvRpt = (GapScan_Evt_AdvRpt_t*) (pMsg->pData);

         multi_role_findSvcUuid(SIMPLEPROFILE_SERV_UUID, pAdvRpt->addr, pAdvRpt->addrType, pAdvRpt->pData, pAdvRpt->dataLen, pAdvRpt->rssi);

if (0 != (pAdvRpt->evtType &= ADV_RPT_EVT_TYPE_SCAN_RSP))

{

    UART_write(UartHandle, pAdvRpt->addr, 6);

    UART_write(UartHandle, pAdvRpt->pData, pAdvRpt->dataLen);

}
else
{

    UART_write(UartHandle, pAdvRpt->addr, 6);

    UART_write(UartHandle, pAdvRpt->rssi, 1);

    UART_write(UartHandle, pAdvRpt->pData, pAdvRpt->dataLen);
}

// Free scan payload data
if (pAdvRpt->pData != NULL)
{
    ICall_free(pAdvRpt->pData);
}

}

break;

 

But I am not getting the device name. Please guide me so that I can do this.

 

Thanks in advance..

 

  • Hi Vijay,

    1) The advertisement data //length of this data field is wrong. You're not adding the adtype byte. Please see the Scanning and Advertising SLA:

    2) Per default the application uses uart for the display driver. Have you removed this?

    3) Did you see the instructions for printing the advertisement data in the SLA? You should be able to configure the same code snippet for scan response data.