Skip to main content
CChon.0
Associate II
August 4, 2019
Question

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 ?

  • August 4, 2019
  • 9 replies
  • 2707 views

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. 

This topic has been closed for replies.

9 replies

Winfred LU
ST Employee
August 5, 2019

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

0690X00000981M5QAI.png

CChon.0
CChon.0Author
Associate II
August 5, 2019

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
August 5, 2019

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
CChon.0Author
Associate II
August 5, 2019

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
August 5, 2019

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

CChon.0
CChon.0Author
Associate II
August 7, 2019

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

Winfred LU
ST Employee
August 8, 2019

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