cancel
Showing results for 
Search instead for 
Did you mean: 

I'm trying to use Bluenrg2 as a ble scanner GAP_CENTRAL_ROLE to receive Beacon data. How do I see the complete raw advertisement data ?

CChon.0
Associate II

In hci_le_advertising_report_event I only see type 0x01,0x08,0x0A and 0x03 in the Advertising_Report_t. I don't see the 0xFF advertisement data. 

9 REPLIES 9
Winfred LU
ST Employee

The complete advertising data (or scan response) is supposed to be in *Data, in the followed format:

0690X00000981M5QAI.png

CChon.0
Associate II

Thank you for your reply. The advertisement data I'm looking for was not found in the *Data segment of the advertising_report_t variable. When I use a mobile app like nRF Connect or ble scanner on Android to view the raw data it is before the name of the ble device. The data I circled in the attached image is in the *data but not the data above which I am trying to read. It consists of the major and minor values from a beacon.

Please help. Thank you

Winfred LU
ST Employee

Hi Chong,

Please note that normally the advertising payload has length up to 37 bytes, including ADV address (6 bytes), which makes advertising data 31 byte maximum.

The advertising data can be partitioned into two, located in an ADV_IND and in a Scan response.

In your case, AD data type 0x01 and 0xff consist 31 bytes, and there shall be one more following report (event) containing the AD data type 0x08, 0x0a, and 0x03.

I replicated the advertising more than 31 bytes with "nRF Connect", the follow screenshots show data separately in two events:

0690X00000981PEQAY.png

0690X00000981PJQAY.png

Best Regards,

Winfred

CChon.0
Associate II

Hi Winfred

Thank you for your prompt reply. Do you mean that the hci_le_advertising_report_event will be triggered twice since the data length exceeds 37 bytes And the contents will be different ?

Thank you

Best regards,

Chong

Winfred LU
ST Employee

Hi Chong,

Yes. The second advertising report will have Event_Type equal to 4 (Scan Rsp), which is actually the response to the active scanning.

The primary advertising report may have Event_Type from 0 to 3 according to advertiser settings.

It is the beacon (advertising data) sent periodically every advertising interval.

Best Regards,

Winfred

Hi Wilfred,

Thank you for your reply. Is there a limit of the number of BLE messages received during scanning ?

I seem to be scanning max 12 BLE devices and misses the rest that I want to get.

Thank you

Best regards,

Chong Chieh Tseng

Willowmore Pte Ltd

Hi Chong,

There is no such limit.

Possibly you configured the scanning window too short, so only 12 advertising packets can be scanned in that tiny period.

Please configure scanning interval and window properly.

It will be fine to set the scanning window the same as interval.

0690X0000098FWoQAM.png

Best Regards,

Winfred

Hi Winfred,

Thank you for your reply. I am able to scan for the device but still unable to receive the beacon advertising data. I noticed that the address is the same for both advertising report and have tried in my code to look for the specific address but there is still only one report for that beacon.

I also tried using

ret = aci_gap_start_general_discovery_proc(0x4000,0x4000,0x01,0x01);

and

ret = aci_gap_start_general_discovery_proc(0x4000,0x4000,0x01,0x00);

for finding duplicates but it still doesn't appear. I assume for duplicates is only for duplicate message sent during the scan window ?

Thank you

Best regards,

Chong

> I am able to scan for the device but still unable to receive the beacon advertising data.

There is contradiction. Being able to scan for the device means being able to receive the advertising data.

> I noticed that the address is the same for both advertising report

It is correct that the address is the same.