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.

GAP_DEVICE_INFO_EVENT source identification in CC2640

Other Parts Discussed in Thread: CC2640

For the CC2640 BLE chip i am using the simpleBLECentral example project.

For starting the discovery i am using the code 

GAPCentralRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,
DEFAULT_DISCOVERY_ACTIVE_SCAN,
DEFAULT_DISCOVERY_WHITE_LIST);

1. After this call whether i will get two times the event GAP_DEVICE_INFO_EVENT (i.e first event after the advertisement detection and the second event after receiving the scan response) when a device is detected (since i have initiated active scan )

2. If above is true can we differentiate the reason for GAP_DEVICE_INFO_EVENT (i.e whether due to advertisement detection or due to reception of scan response) using the variable gapDeviceInfoEvent_t->eventType in the function SimpleBLECentral_processRoleEvent?

  • Hi,

    See gap.h for the definitions of the device info structure.
    /**
    * GAP_DEVICE_INFO_EVENT message format. This message is sent to the
    * app during a Device Discovery Request, when a new advertisement or scan
    * response is received.
    */
    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 GAP_ADDR_TYPE_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;


    Event type should tell you if it is a scan response or just an advertisement report.

    Best wishes