Beacon
This section presents the user interactions and testing methods for the Beacon application.
Advertising data
The beacons are non-connectable advertising packets that are sent on the three advertising channels. The latter contains the following fields.
Company Identifier (2 bytes): 0x0025 (NXP ID as defined by the Bluetooth SIG).
Beacon Identifier (1 byte): 0xBC (Allows identifying an NXP Beacon alongside with Company Identifier).
UUID (16 bytes): Beacon sensor unique identifier.
A (2 bytes): Beacon application data.
B (2 bytes): Beacon application data.
C (2 bytes): Beacon application data.
RSSI at 1m (1 byte): Allows distance-based applications.
By default, the UUID value is a random value based on the unique identifier of the board.
Parent topic:Beacon
Supported platforms
The following platforms support the Beacon application:
KW45B41Z-EVK
K32W148-EVK
FRDM-MCXW71
KW47-EVK
MCXW72-EVK
FRDM-MCXW72
Parent topic:Beacon
User interface
After flashing the beacon, the sensor is put in deep sleep (all LEDs are off). To flash the board in case the beacon is put in Deep-sleep mode, press the ADVSW or RESET button. After this step, any attached debugger loses its connection. The default configuration of the application enables low power, which disables LED support. The user can manually change the configuration and enable LED support, otherwise all subsequent LED behavior references are ignored.
By default, the application uses extended advertising. However, it can be configured to use legacy advertising by setting the gBeaconAE_c
define to 0
. In the legacy configuration, the first press of the advertising switch starts the legacy advertising and the second press stops it.
The table below lists details of the hardware references for the Beacon application.
Platform |
ADVSW |
ADVLED |
EXTADVLED |
---|---|---|---|
KW45B41Z-EVK / K32W148-EVK |
SW2 |
LED2 |
LED1 |
FRDM-MCXW71 |
SW2 |
Blue LED |
RGB LEDS |
KW47-EVK / MCXW72-EVK |
SW2 |
LED2 |
LED1 |
FRDM-MCXW72 |
SW4 |
Blue LED |
RGB LEDS |
Parent topic:Beacon
Usage
The beacon can be tested with any Bluetooth® Smart Ready products available on the market. The IoT Toolbox can also be used to showcase the profile functionality, as shown in the figure (IoT Toolbox Beacon Demo) below.
Parent topic:Beacon
Beacon usage with extended advertising
To use the Beacon application with the advertising extensions capabilities, the gBeaconAE_c define
option must be set to 1. Doing this enables the usage of extended advertising and periodic advertising. The application cycles between these modes are in the following manner:
The first ADVSW press starts legacy advertising, CONNLED turns solid.
The second ADVSW press stops legacy advertising and starts extended advertising, CONNLED turns off, EXTADVLED turns solid.
The third ADVSW press stops extended advertising carrying data and then starts extended advertising without data and periodic advertising, EXTADVLED starts flashing.
The fourth ADVSW press stops periodic advertising and extended advertising without data and starts legacy advertising and extended advertising, both CONNLED and EXTADVLED turn solid.
The fifth ADVSW press stops them all, both CONNLED and EXTADVLED turn off.
Note: Periodic advertising support is currently disabled at Link Layer level.
Not all smartphones support extended advertising, hence a different method to view the AE beacon is to use the ble_shell
application. In order to do this, perform the following steps:
Flash a board with the beacon application, as described above.
Flash a board with the ble_shell application, as described in Bluetooth LE Shell and connect to it using a serial port.
Press the ADVSW button two times on the beacon to start extended advertising on the coded PHY.
To view the advertising data, enter the following commands in the shell terminal to set the scanning PHY to coded and start scanning. See the figure below.
|To start the periodic advertising, press ADVSW button again on the beacon.
Note: Periodic advertising support is currently disabled at Link Layer level.
To sync with the beacon, issue the following commands on the shell terminal as shown in the figure below.
|
The peer parameter of the
periodicsync
command is the public address of the beacon.
Extended Advertising with very large data
To use very large advertising data for extended advertising, set the gBeaconLargeExtAdvData_c
define
to 1. The same steps are used to view the data using ble_shell
:
Flash a board with the beacon application.
Flash a board with the ble_shell application, as described in Bluetooth LE Shell and connect to it using a serial port.
Press the ADVSW button two times on the beacon to start extended advertising on the coded PHY.
To view the advertising data, enter the following commands in the shell terminal to set the scanning PHY to coded and start scanning. See the figure below.
Parent topic:Beacon
Parent topic:Bluetooth LE stack and demo applications