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.

simple_observer扫描到的设备



请问扫到的设备的信息存在哪里,一直没找到

  • 请看如下两个事件:
    GAP_DEVICE_INFO_EVENT 每发现一个设备就会产生一次 ,对应的是pEvent->deviceInfo

    GAP_DEVICE_DISCOVERY_EVENT 是发现过程完成了产生一次,对应的是pEvent->discCmpl.numDevs

    可在相应的结构体中查找信息,比如:

    typedef struct
    {
    osal_event_hdr_t hdr; //!< GAP_MSG_EVENT and status
    uint8 opcode; //!< GAP_DEVICE_INFO_EVENT
    uint8 eventType; //!< Advertisement Type: @ref GAP_ADVERTISEMENT_REPORT_TYPE_DEFINES
    uint8 addrType; //!< address type: @ref ADDRTYPE_DEFINES
    uint8 addr[B_ADDR_LEN]; //!< Address of the advertisement or SCAN_RSP
    int8 rssi; //!< Advertisement or SCAN_RSP RSSI
    uint8 dataLen; //!< Length (in bytes) of the data field (evtData)
    uint8 *pEvtData; //!< Data field of advertisement or SCAN_RSP
    } gapDeviceInfoEvent_t;

    typedef struct
    {
    osal_event_hdr_t hdr; //!< GAP_MSG_EVENT and status
    uint8 opcode; //!< GAP_DEVICE_DISCOVERY_EVENT
    uint8 numDevs; //!< Number of devices found during scan
    gapDevRec_t *pDevList; //!< array of device records
    } gapDevDiscEvent_t;