nRF51 SDK - S120 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
BLE Multi-link Example

Functionality

The BLE Multi-link Central application together with the BLE Multi-link Peripheral application tests the multi-link functionality of the S120 SoftDevice. The BLE Multi-link Example demonstrates how one central device can connect to multiple peripheral devices.

The source code and project file can be found in the following folders:
<InstallFolder>\Nordic\nrf51822\Board\nrf6310\s120\ble_app_multilink_central
<InstallFolder>\Nordic\nrf51822\Board\nrf6310\s120\ble_app_multilink_peripheral

Note
Although the folder ble_app_multilink_peripheral is placed under s120 folder, it needs the S110 SoftDevice to work. Its primary use is to act as helper application to test the ble_app_multilink_central example, thus it is placed in the s120 folder.

On startup, the peripheral devices will start advertising. Once connected to the central, pressing button 0 on the peripheral toggles the state of LED 0 on the peripheral and a corresponding LED on the central. When multiple peripherals are connected, each peripheral is assigned one LED by the central depending on the order in which the peripherals got connected. For example, LED 0 will be assigned to the peripheral that connects first. LED 1 will be assigned to the peripheral that connects second and so on.

Setup

The BLE multi-link example requires at least three boards to verify that more than one link is active. The central device can have a maximum of 8 concurrent connections to peripheral devices, which corresponds to 8 LEDs. Consequently, the BLE Multi-link Central application is designed for the nRFgo Motherboard (nRF6310). The BLE Multi-link Peripheral application is designed for the Evaluation Kit PCA10001.

Instructions on how to set up the nRFgo Motherboard: nRFgo Motherboard Setup (nRF6310).

Button and LED Assignments

LED assignments PCA10001 Peripheral:

  • LED 0: Advertising. When in Connected state, this LED toggles each time button 0 is pressed.
  • LED 1: Connected and the central application has configured it to send notifications.

Buttons assignments PCA10001 Peripheral:

  • Button 0: Toggle LED 0 on peripheral side (local board) and assigned LED on Central side

LED assignments nRF6310 Central:

  • LED 0-7: Assigned first come first serve to connecting peripherals. Toggled on and off based on notifications received from the respective peripherals.

Porting the central example to run on evaluation board

The central application can be easily ported to run on a PCA10001 evaluation board. The only changed needed would be adapt to the two LEDs on evaluation board. To do this, the preprocessor define BOARD_NRF6310 (available in Keil uVision IDE at Projects->Options for...->C/C++) should be changed to BOARD_PCA10001. Since the evaluation board has only two LEDs, it can visually identify only two links. If more than two links need to be supported, UART logging (for example) can be used instead of the LEDs.

Testing

Tested with one nRFgo Motherboard (nRF6310) and two evaluation kits (PCA10001).

  1. Compile and program the peripheral application onto the two PCA10001 kits. Observe that advertising LED 0 is lit on both the boards. This means they are advertising and are waiting for the central device to connect.
  2. Compile and program the central application onto the nRF6310 board.
  3. As soon as the central application is programmed, it starts scanning and attempts to connect to the peripherals and enable notifications. Hence on the PCA10001 kits, observe that the advertising LED 0 turns off and the LED 1 turns on after a few seconds.
  4. Press button 0 on one of the peripherals. Observe that LED 0 of that peripheral is turned ON and one of the LEDs on the central turns ON.
  5. Press button 0 again on the same peripheral again. Observe that LED 0 on the peripheral is turned OFF and the corresponding LED on the central is turned off.
  6. Repeat the last two steps with other connected peripherals and observe the same behavior.