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 / SDK_4_20_00_04:官方例程simple_central 如何修改才能接收从机的Scan Response Data?

我在simple_central.c --  SimpleCentral_processAppMsg函数的 case SC_EVT_ADV_REPORT:中添加打印

结果如下:pAdvRpt->dataLen : 7

pAdvRpt->pData 内容是 0201060302F0FF。 这个应该是从机的广播包数据,请问怎样才能收到从机扫描应答数据?

  • 可以通过主机Role Event Callback回调函数中的GAP_DEVICE_INFO_EVENT是告知主机接收到从机的Adv Data或者Scan Response
  • *pEvtData; //!< Data field of advertisement or SCAN_RSP
    此指针指向扫描相应数据或者广播数据,在case GAP_DEVICE_INFO_EVENT里
  • 我主机运行的例程是ble5stack\simple_central,而你提到的GAP_DEVICE_INFO_EVENT 出现在blestack\gap.h头文件中,我查了下在ble5stack中的gap.h头文件中也没有 GAP_DEVICE_INFO_EVENT。难道我必须要运行blestack\simple_central 或是blestack\multi_role例程才行?
  • 我主机运行的例程是ble5stack\simple_central,而你提到的GAP_DEVICE_INFO_EVENT 出现在blestack\gap.h头文件中,我查了下在ble5stack中的gap.h头文件中也没有 GAP_DEVICE_INFO_EVENT。难道我必须要运行blestack\simple_central 或是blestack\multi_role例程才行?
  • ble5stack对名称进行了修改,查下GAP_EVT_ADV_REPORT或GAP_EVT_ADV_REPORT_FULL