Question regarding structure CYBLE_GAPC_ADV_REPORT_T

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

The definition of this structure is: 

typedef struct

{

/** Advertisement event type

    - Connectable undirected advertising = 0x00

    - Connectable directed advertising = 0x01

      - Scannable undirected advertising = 0x02

      - Non connectable undirected advertising = 0x03

      - Scan Response = 0x04

    */

CYBLE_GAPC_ADV_EVENT_T eventType; 

/** bd address type of the device advertising.

- CYBLE_GAP_ADDR_TYPE_PUBLIC

- CYBLE_GAP_ADDR_TYPE_RANDOM

- CYBLE_GAP_ADDR_TYPE_PUBLIC_RPA

- CYBLE_GAP_ADDR_TYPE_RANDOM_RPA

    */

    uint8      peerAddrType;

/** Public Device Address or Random Device Address for

   each device which responded to scanning. */

    uint8*     peerBdAddr;

/** length of the data for each device that responded to scanning */

    uint8        dataLen;

/** Pointer to advertising or scan response data */

    uint8*     data;

/** Rssi of the responding device.

* Range: -85 <= N <= 0

* Units: dBm */

    int8     rssi;

} CYBLE_GAPC_ADV_REPORT_T;

For the data section, no distinction is made between a scan response packet or an advertising packet.  data seems to lump the two together.   Does this mean the data length can be 31 * 2 = 62?   Should I expect advertising data to be in the first 31 bytes (0 .. 30) and the Scan Response Data to be in the second 31 bytes (31 .. 61)?  How are the two discriminated in this structure? 

0 Likes
1 Solution
Anonymous
Not applicable

It appears you generally get two transmissions, some with duplicate info.  But One Transmission Contains your advertising packet data while the second separate transmission contains your Scan Response Data.   So the data is limited to the 31 bytes.  It's just that it is sent out separately as two different packets.

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

It appears you generally get two transmissions, some with duplicate info.  But One Transmission Contains your advertising packet data while the second separate transmission contains your Scan Response Data.   So the data is limited to the 31 bytes.  It's just that it is sent out separately as two different packets.

0 Likes
Anonymous
Not applicable

Yes you are right! The callback will be triggered twice, once for the adv report and once for the scan response. Using the "eventType" parameter of the report, you can differentiate between the two.

0 Likes