nRF5 SDK v17.1.0
Immediate Alert Server Application
This example requires one of the following SoftDevices: S132, S140

Important: Before you run this example, make sure to program the SoftDevice.

The Immediate Alert Server Application is an example that implements an Immediate Alert Service Server using the hardware delivered in the nRF5 Development Kit. The Immediate Alert Server example can receive alerts from multiple Immediate Alert Client Applications.

The application includes the Immediate Alert Service and Battery Service.

When the Central is scanning for Peripherals, it looks for devices advertising the Immediate Alert Service. When the device is connected and the bonding procedure is successful, the Central starts to scan again if the limit for concurrent connections is not exceeded. Scanning is also automatically restarted at a disconnection.

In the multilink scenario, when an alert is signaled using the Immediate Alert Service for the specific connection, its priority is compared to the alert priorities reported by other connected peers and the highest value from this group is considered to be the valid alert level of the application. Then, the chosen alert level is indicated using LED 3.

The application stores information about the battery level for connected peers and sends it to the bonded peer after reconnecting, if the battery level value differs from the value registered when the peer disconnects.

Note
  • This application is not power optimized!
  • The device must be in bonded state to change the characteristic in this application. Bonding is performed automatically by the application.

Setup

Three boards are needed to perform this test:

The application running on the Peripheral boards is intended to serve as a peer to this Immediate Alert Central application.

LED assignments

Button assignments

Testing

Test the BLE Immediate Alert Example application by performing the following steps:

  1. Compile the Immediate Alert Example application and program both the SoftDevice and the application on the Central board.
  2. On the Central board, observe that LED 1 is on. This indicates that the application is scanning for Immediate Alert Peripherals.
  3. Compile the Immediate Alert Client application and program both the SoftDevice and the application on the first Peripheral board.
  4. Observe that the Immediate Alert Client is advertising.
  5. Once the connection is established, LED 2 is lit on the Central board and BSP_INDICATE_CONNECTED state is indicated on the Peripheral board.
  6. Wait for the bonding procedure to finish. Upon successful bonding, the Central device restarts the scanning. Observe that LED 1 is on again.
  7. On the Peripheral board, press Button 1 to signal an alert. By pressing Button 1, you can switch between different Alert Levels (BSP_INDICATE_ALERT_0, BSP_INDICATE_ALERT_3, and BSP_INDICATE_ALERT_OFF). On the Central board, observe that the different Alert Levels are indicated.
  8. Compile the Immediate Alert Client application and program both the SoftDevice and the application on the second Peripheral board.
  9. Observe that the second Immediate Alert Client is advertising. No new connection can be established, because the Central device is scanning with active whitelist.
  10. Press Button 2 for a longer time (2 s) on the Central board. This starts scanning without whitelist.
  11. Once the second connection is established, the BSP_INDICATE_CONNECTED state is indicated on the second Peripheral board. Observe that LED 1 is off on the Central board because all connection slots are used.
  12. Press Button 1 on either of the Peripheral boards to signal alerts. Observe that the alert level is indicated with LED 3, as per policy that was presented in example description - the highest reported alert level is indicated.
  13. Disconnect the devices, for example by pressing the Reset Button on the Central board. Observe that the boards automatically reconnect and that it is again possible to set the Alert Level.

Documentation feedback | Developer Zone | Subscribe | Updated