nRF5 SDK v15.0.0
Experimental: Link Loss Application
This example requires one of the following SoftDevices: S112, S132, S140

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

The Link Loss Application is an example that implements the Link Loss Service using the hardware delivered in the nRF5 Development Kit. The Link Loss example alerts the user when connected devices are too far apart.

The application includes the Link Loss Service.

At each power up and disconnect, the Link Loss Application will perform 3 minutes of fast advertising without whitelist, which is indicated by the BSP_INDICATE_ADVERTISING state. It will then switch to sleep mode, and the state BSP_INDICATE_IDLE is indicated. When the link is lost, an alert is indicated using the state BSP_INDICATE_ALERT_0 or BSP_INDICATE_ALERT_3, depending on the value of the Alert Level characteristic.

Note
This application is not power optimized!
  • The device must be in bonded state to change the characteristic in this application.
  • The application will stop advertising and go to system-off mode after 3 minutes and 30 seconds (if no advertising with whitelist was done) or after 4 minutes (if advertising with whitelist was done). Push Button 1 to restart advertising, or push and hold Button 2 for 5 seconds to erase all bonds and restart advertising.
  • Upon disconnecting a bonded connection, the application will advertise with whitelist for ADV_INTERVAL_FAST_PERIOD seconds. After this time-out, the application will be able to bond to a new central.

Setup

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ble_peripheral\experimental\ble_app_lls

Button assignments - in addition to those defined in BSP BLE Button Assignments:

Testing

Test the Link Loss Application with the nRF Toolbox app, which is available on both iOS (App Store) and Android (Google Play).

You can also test the application with nRF Connect by performing the following steps:

  1. Compile and program the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
  2. Connect to the device from nRF Connect (the device is advertising as 'Nordic_Link_Loss'), then bond to the device. To bond, click the settings button for the device in nRF Connect, select "Pair", check "Perform Bonding", and click "Pair". Wait until the bond is established before you continue. Observe that the BSP_INDICATE_CONNECTED state is indicated.
  3. Set the Alert Level characteristic in Link Loss Service to 1 (enter '01' in the text box, and click the 'write' button).
  4. Simulate a link loss situation, for example by shielding the board or moving it out of range, and observe that the BSP_INDICATE_ALERT_0 and BSP_INDICATE_ADVERTISING are indicated.
  5. Reconnect and observe that only the BSP_INDICATE_CONNECTED state is indicated.
  6. Set the Alert Level characteristic in Link Loss Service to 2 (enter '02' in the text box, and click the 'write' button).
  7. Simulate a link loss situation, for example by shielding the board or moving it out of range, and observe that the BSP_INDICATE_ALERT_3 and BSP_INDICATE_ADVERTISING are indicated.
  8. Reconnect and observe that only the BSP_INDICATE_CONNECTED state is indicated.
  9. Disconnect from nRF Connect.

Documentation feedback | Developer Zone | Subscribe | Updated