2014-06-07 01:48 AM
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 #bluenrg2014-06-10 07:02 AM
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_discoverableOn 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 addressThe BlueNRG supports both active that passive scanning.
regards,
Graziella2014-06-10 11:17 AM
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 - Charles2014-06-17 03:04 AM
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_DISCOVERABLEFrom 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 Graziella2015-05-28 05:34 PM
Did you ever create a demo for general discovery including vendor specific information in the advertising packet? I need this badly.
2015-06-03 07:37 AM