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

Functionality.

This example together with s110 peripheral helper applications tests the multi-link functionality of the S120 SoftDevice.

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

Note
Although the folder ble_app_multilink_peripheral is placed under s120 folder, it needs the S110 SoftDevice to work. It is placed under s120 folder because the primary use of this application is to act as a helper application to test the multi-link central example.

The central device can connect to up to eight peripherals. The Development kit nRF6310 is used as Central since the central application needs more LEDS, while the Evaluation Kit PCA10001 is used for the peripherals.

Setup

The multi-link example requires at least three boards to verify that more than one link is active. It is preferred to use one nRFgo Motherboard and two or more evaluation kits for testing this application.

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.

Functionality

The peripheral application on startup will begin 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.

Porting the central example to run on evaluation board

The central application can be easily ported to run on an 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 1 nRFgo Motherboard board and two evaluation kits

  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.
  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.