cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG missing LE Advertising Report Event

charles23
Associate III
Posted on June 07, 2014 at 10:48

I can get two BlueNRG boards connecting, one as Peripheral and one as Central, using the code in the BLE_Chat example. In this case the Central has to know in advace the address of the Peripheral.

However, when I try to program my Central in a more realistic mode, asking it to scan for nearby Peripherals, I do not get any LE Advertising Report events. I have copied the sequence diagrams in the Bluetooth Specification, and tried both active and passive scanning. So I don't know whether I am sending the wrong commands to the BlueNRG, or whether the BlueNRG does not support Passive Scanning and Active Scanning.

Can ST please provide example code, or a sequence of commands, for Active scanning?

#advertising #scanning #bluenrg
5 REPLIES 5
Posted on June 10, 2014 at 16:02

Hi,

If you want to connect to a BlueNRG device with unknown address, you can use the command aci_gap_start_general_discovery_proc that starts the active scanning and return the address of all devices in discovery mode.

Therefore, on Peripheral you have to perform the commands:

- aci_gatt_init

- aci_gap_init with peripheral ole

- aci_set_discoverable

On Central, you have to perform the commands

- aci_gatt_init

- aci_gap_init with central role

- aci_gap_start_general_discovery_proc, the addresses of all devices in discoverable mode will be returned,

- aci_gap_create_connection using the returned address

The BlueNRG supports both active that passive scanning.

regards,

Graziella

charles23
Associate III
Posted on June 10, 2014 at 20:17

Hi Graziella

I had just discovered the same thing, and was going to post my discovery here. So my first set of questions relate to the use of the standard vs Vendor Specific commands:

1 Why do you implement Vendor Specific commands that more or less duplicate the standard commands? Here you suggest using  the BLUEHCI_GAP_START_GENERAL_DISCOVERY_PROC (0xFC97) command that is similar to the standard HCI_LE_SET_SCAN_PARAMETERS (0x200B) and HCI_LE_SET_SCAN_ENABLE (0x200C) pair.

 

2 More importantly, how can I tell which commands work and which do not? The calls to the two standard commands return BLE_STATUS_SUCCESS yet don't work.

Next, please provide guidance on how to do the discovery process. The missing LE Advertising Report Event should return the contents of the Advertisng Data packets, but the EVT_BLUE_GAP_DEVICE_FOUND event that follows the BLUEHCI_GAP_START_GENERAL_DISCOVERY_PROC command returns only the Peripheral address.

3 How can I read the Peripheral's Advertising Data? Do I have to connect to the device, then read some attributes, then disconnect if it is not the device I want? (If so, how do I do this?) Or is there some other way to find the Advertising Data?

4 You say that the BlueNRG supports both passive and active scanning. How? The standard HCI_LE_SET_SCAN_PARAMETERS call has an active/passive parameter, but BLUEHCI_GAP_START_GENERAL_DISCOVERY_PROC does not (the documentation says it does active scanning - but what is the point if I can't access the Advertising Data?).

Again, I assume that someone at ST Micro must have written a real application that implements a realistic Central. So:

5 Will you please publish the source code of an application that implements a realistic Central device? It is very inefficient to figure this out experimentally.

Thanks - Charles

Posted on June 17, 2014 at 12:04

Dear Customer,

1)In according to the specific, each Vendor can define their own ''Vendor Specific command'' based on the hardaware implementation.

2)Only if a command has send with successfully the HCI_COMMAND_COMPLETE event return the status equal to success.

3-4)With the firmware version 6.3, it's not possible to obtain (from ADV data) the name of peripheral using Gap layer command (BLUEHCI_GAP_START_GENERAL_DISCOVERY_PROC command returns only the Peripheral address). This limitation will be fixed as soon as possible.

To obtain also the name of peripheral you must use HCI command, therefore:

From Peripheral, you have to the following commands:

- Click on Reset button

- BLUEHCI_GATT_INIT

- BLUEHCI_GAP_INIT with peripheral role

- BLUEHCI_GAP_SET_DISCOVERABLE

From Central, you have to send the following commands:

- Click on Reset button

- HCI_LE_SET_SCAN_PARAMETERS

- HCI_LE_SET_SCAN_ENABLE (LE_Scan_Enable=0x01)

The central will receive the event HCI_LE_META containing the address and the name of peripheral.

5)We are working on this point and we hope to publish as soon as possible the source code of an example of a realistic Central device.

Thanks a lot

Best Regards

Graziella

Posted on May 29, 2015 at 02:34

Did you ever create a demo for general discovery including vendor specific information in the advertising packet? I need this badly.

Posted on June 03, 2015 at 16:37

Hi Tony,

if you download the latest version of GUI DK, for example you can see the script related to Beacon example.

Regards,

GM