20719 reports wrong advertisement data

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

cross mob
JeHu_3414236
Level 5
Level 5
10 likes received First like received

I am starting BLE scan by calling wiced_bt_ble_scan(BTM_BLE_SCAN_TYPE_HIGH_DUTY, TRUE, newAdvCallback) to enable duplicate filtering.  I am seeing wrong advertisement data being reported.  This is the trace of advertisement callbacks logging device address:

19:48:27.230 1 adv=b8 78 2e 39 fb a1

19:48:27.233 1 adv=b8 78 2e 39 fb a1

19:48:27.267 1 adv=6e 66 87 a5 77 e3

19:48:27.270 1 adv=6e 66 87 a5 77 e3

19:48:27.515 1 adv=50 99 e4 84 62 bb

19:48:27.517 1 adv=50 99 e4 84 62 bb

19:48:27.520 1 adv=7e 70 76 4c 41 a1

19:48:27.523 1 adv=7e 70 76 4c 41 a1

19:48:27.825 1 adv=58 3c df 89 c2 a0

19:48:27.826 1 adv=58 3c df 89 c2 a0

19:48:29.308 1 adv=c2 35 dd 81 0b a9

19:48:29.310 1 adv=c2 35 dd 81 0b a9

19:48:32.189 1 adv=5b 2b a2 b2 ae 75 //advertisement

19:48:33.088 1 adv=cb 97 74 54 b6 89

19:48:33.097 1 adv=cb 97 74 54 b6 89

19:48:33.273 1 adv=5b 2b a2 b2 ae 75 //scan response - error in data

In normal situations, I get 2 callbacks back-to-back from the same device, the first for the advertisement and the second for the scan response.  In cases where the advertisement is received but the immediate scan response is lost, I see wrong data reported in the callback when the scan response is received later.  This case happens for the device 5b 2b a2 b2 ae 75.  When I receive the scan response callback for 5b 2b a2 b2 ae 75, the data is from the previous scan response callback corresponding to the device cb 97 74 54 b6 89.  Can someone confirm this problem and how to work around it?  Thanks.

0 Likes
1 Solution
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

Hi jhu_3414236​,

I did not see this problem but it may happen that advertisement packet is received from one peripheral and you are getting packets from another peripheral before getting the scan response from the first one. This is the request-response process which cannot be controlled. If you want to get the packets from a particular device only, then you can put that device in white list and then scan.

View solution in original post

1 Reply
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

Hi jhu_3414236​,

I did not see this problem but it may happen that advertisement packet is received from one peripheral and you are getting packets from another peripheral before getting the scan response from the first one. This is the request-response process which cannot be controlled. If you want to get the packets from a particular device only, then you can put that device in white list and then scan.