UM2264
BlueNRG-1 Beacon
demonstration application
DocID030868 Rev 1
25/55
6
BlueNRG-1 Beacon demonstration application
The BlueNRG-1 Beacon demo is supported by the SPBTLE-1S or BlueNRG-1
development platform (STEVAL-IDB007V1 or STEVAL-IDB007V1M). It demonstrates how
to configure a SPBTLE-1S or BlueNRG-1 device to advertise specific manufacturing data
and allow another BLE device to determine whether it is in BlueNRG-1 BLE Beacon device
range.
6.1
BLE Beacon application setup
This section describes how to configure a BlueNRG-1 device to act as a Beacon device.
6.1.1
Initialization
The BlueNRG-1 BLE stack must be correctly initialized thus:
aci_gatt_init();
aci_gap_init(GAP_PERIPHERAL_ROLE, 0, 0x08, &service_handle, &dev_name_char_handle,
&appearance_char_handle);
See the BlueNRG-1 BLE stack documentation for more information on these and following
commands.
6.1.2
Define advertising data
The BLE Beacon application advertises the following manufacturing data:
Table 5: BlueNRG-1 Beacon advertising manufacturing data
Data field
Description
Notes
Company identifier
code
SIG company identifier
Default is 0x0030 (STMicroelectronics)
ID
Beacon ID
Fixed value
Location UUID
Beacons UUID
Used to distinguish specific beacons from
others
Major number
Identifier for a group of
beacons
Used to group a related set of beacons
Minor number
Identifier for a single beacon
Used to identify a single beacon
Tx Power
2's complement of the Tx
power
Used to establish how far you are from
device
Notes:
(1)
available at: https://www.bluetooth.org/en-us/specification/assigned-numbers/company-identifiers
6.1.3
Entering non-connectable mode
The BLE Beacon device uses the GAP API command to enter non-connectable mode thus:
aci_gap_set_discoverable(ADV_NONCONN_IND, 160, 160, PUBLIC_ADDR,
NO_WHITE_LIST_USE,0, NULL, 0, NULL, 0, 0);
To advertise the specific selected manufacturer data, the BLE Beacon application can use
the following GAP APIs: