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.

CC2340R5: Advertising pData parsing for scan results

Part Number: CC2340R5

Hello,

Are there any utilities in the SDK that allow for parsing of data received from a scan report?

I have a CC2340 configured as a central and am scanning for a device advertising with a specific 128 bit UUID in the advertisement data. 

This is the format of the advertising data that I'm sending out:

uint8_t advData1[] =
{
  0x02,
  GAP_ADTYPE_FLAGS,
  GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED | GAP_ADTYPE_FLAGS_GENERAL,

  0x11,
  GAP_ADTYPE_128BIT_MORE,
  0x1d,
  0xe9,
  0xd9,
  0xe7,
  0x62,
  0x7c,
  0x44,
  0xad,
  0x90,
  0xd8,
  0x0f,
  0xbb,
  0x86,
  0x1f,
  0x73,
  0x99,




};

On the central side I'm currently just looking for 0x11 followed by GAP_ADTYPE__128BIT_MORE:

        case BLEAPPUTIL_ADV_REPORT:
        {
            bleStk_GapScan_Evt_AdvRpt_t *pScanRpt = &scanMsg->pBuf->pAdvReport;
            if (pScanRpt->pData != NULL)
            {
                uint8_t indx = 0;
                while (indx < pScanRpt->dataLen)
                {
                    // index is greater than 1 and 128 Bit UUID
                    if (indx && pScanRpt->pData[indx] == GAP_ADTYPE_128BIT_MORE) {
                        // check length field
                        if(pScanRpt->pData[indx-1] == 0x11 && indx+0x11 <= pScanRpt->dataLen) {
                            snprintf(sUUID, sizeof(sUUID),"%X",&pScanRpt->pData[indx+1]);
                            MenuModule_printf(APP_MENU_SCAN_EVENT + 1, 0, "128 Bit UUID: %s", sUUID);
                            //for(size_t i = indx+1; i < indx+0x10; i++ ) {
                            //    MenuModule_printf(APP_MENU_SCAN_EVENT + 1, 14+i-indx-1, "%x", pScanRpt->pData[i]);
                            //}
                        }
                    }
                    //
                    indx++;
                }
            }

But this is not printing the data I expect and based on the results that I'm seeing I'm hesitant to just do a full memcmp to determine a match.

So I just wanted to check do we have any utilities I could use within the stack that would parse this scan report data and returns a pointer to the requested field value?

Munan