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:CC2340R5 The primary device cannot obtain scan response packet data

Part Number: CC2340R5

SDK:simplelink_lowpower_f3_sdk_7_40_00_64

您好,我正在使用CC2340R5作为主机来扫描周围的设备。我已经获取了周围设备的MAC地址和RSSI,但无法获取响应包的数据

  • Hello,

    Thanks for reaching out to us.

    Please be aware this is a English language forum, in case you would not like to continue in English you can post your inquiry as well here: https://e2echina.ti.com.

    May I ask the following question to better understand the situation?

    1. What example from the SDK are you using (basic_ble?)
    2. Do you have a peripheral with an advertisement report that you know has an expected pData? How are you testing this?

    BR,

    David.

  • 1、I'm using my own project

    2、I have a lot of peripherals nearby, I know what to expect from PData, and I use my phone's nrf connect APP to look at the peripherals' broadcast packet and response packet data%MCEpastebin%

  • Hello, I have some new discoveries, I checked this part of.syscfg, it can appear datalen, but still no pdata

  • Hello,

    (Sorry I clicked the wrong TI Thinks resolved button).

    Could you please provide a bit more information about where you are reading the advertisement report (a code snipped of the function where you are handling this could be helpful if it is possible to share).

    Have you included the BLEAPPUTIL_ADV_REPORT as part as your centralScanHandler?

    I would suggest looking into our material here: Bluetooth Low Energy Scanning and Advertising.

    I can also share an e2e thread that shows the required setup to read the advertisement report: https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1278585/cc2340r5-central-to-peripheral-automatically-connect

    BR,

    David.

  • BLEAppUtil_EventHandler_t ttcScanHandler =
    {
        .handlerType    = BLEAPPUTIL_GAP_SCAN_TYPE,
        .pEventHandler  = ttc_ScanEventHandler,
        .eventMask      = BLEAPPUTIL_SCAN_ENABLED  |
                          BLEAPPUTIL_SCAN_DISABLED |
                          BLEAPPUTIL_ADV_REPORT
    };
    
    
    void ttc_ScanEventHandler(uint32 event, BLEAppUtil_msgHdr_t *pMsgData)
    {
        BLEAppUtil_ScanEventData_t *scanMsg = (BLEAppUtil_ScanEventData_t *)pMsgData;
    
        switch (event)
        {
            case BLEAPPUTIL_ADV_REPORT:
            {
                ...
            }break;
    
    
            case BLEAPPUTIL_SCAN_ENABLED:
            {
                ....
            }
            }break;
    
            case BLEAPPUTIL_SCAN_DISABLED:
            {
                uint8_t reason;
                uint8_t numReport;
                uint8_t i;
                uint8_t len;
                uint8_t *pBuffData;
                uint8_t pOutData[100];
                uint8_t pOutDataLen;
                uint8_t test_write[6]={0xff,0xff,0xff,0xff,0xff,0xff};
                uint16_t device_nameLen;
                reason = scanMsg->pBuf->pScanDis.reason;
                numReport = scanMsg->pBuf->pScanDis.numReport;
    
                // Get the address from the report
                for(i = 0; i < APP_MAX_NUM_OF_ADV_REPORTS; i++)
                {
                    memset(&centralScanRes[i], 0, sizeof(App_scanResults));
                }
                for (i = 0; i < scanMsg->pBuf->pScanDis.numReport; i++)
                {
                    GapScan_Evt_AdvRpt_t advReport;
                    GapScan_getAdvReport(i, &advReport);
                    memcpy(centralScanRes[i].address, advReport.addr, B_ADDR_LEN);
                    advdatalen = advReport.dataLen;
                    if(advdatalen>0)
                   {
                       NamepOutDataLen = parse_bleAdvData_ToName(advReport.pData , advdatalen , NamepOutData );
    
                       for(uint8_t j = 0 ;j<NamepOutDataLen;j++)
                        {
                           pOutDataLen = sprintf((char *)pOutData,"%02x",NamepOutData);
                            ttcUart_writeData(pOutData,pOutDataLen);
                        }
                    }
    
    
                    pOutDataLen = sprintf((char *)pOutData," Rssi:%d , address:%02x%02x%02x%02x%02x%02x\r\n",
                                                                                      advReport.rssi,
                                                                                      centralScanRes[i].address[0],
                                                                                      centralScanRes[i].address[1],
                                                                                      centralScanRes[i].address[2],
                                                                                      centralScanRes[i].address[3],
                                                                                      centralScanRes[i].address[4],
                                                                                      centralScanRes[i].address[5]);
    
                    ttcUart_writeData(pOutData,pOutDataLen);
                }
                if(!ttcBle.waitConnFlag)
                {
                    BLEAppUtil_scanStart(&ttcScanStartParams);
                }
    
            }break;
    
            default:
            {
                
            }break;
    
        }
    }
    My expectation is to output the RSSI and mac address of the peripheral (both of which I have implemented), as well as the name of the peripheral, which is what the function parse_bleAdvData_ToName does, but at the moment advReport.pData has no data and I can't parse it

  • Hello,

    As a sanity check, could you please trying the process inside the BLEAPPUTIL_ADV_REPORT case?

    BR,

    David.