Important: Before you run this example, make sure to program the SoftDevice .
The BLE Multi-link Central example application shows how one central can be connected to several peripherals simultaneously. We have use two or more Experimental: BLE Blinky Application as peripherals.
When the Central is scanning for peripherals, LED 1 is on. If it is in one or more connections, LED 2 turns on. (If no more connections can be established LED 1 turns off.) Experimental: BLE Blinky Application Peripherals that connect to the Central will be able to control the Central's LED 3 using Button 1. Similarly, pressing button 1 on the Central will control the LEDs on all the connected Peripherals.
The central application uses the LED Button Service Client . For each link it must allocate an instance of this service. The central application will connect to any peer that has the device name "Nordic_Blinky".
Setup
BLE Multi-link Central: You can find the source code and project file of the example in the following folder:
<InstallFolder>\examples\ble_central\ble_app_multilink_central
BLE Multi-link Peripheral: You can find the source code and project file of the example in the following folder:
<InstallFolder>\examples\ble_peripheral\ble_app_blinky
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.
LED assignments
- LED 1: On when advertising. Off when not advertising (max concurrent links reached).
- LED 2: On while in connection(s).
- LED 3: During connection This LED can be toggled by the connected Experimental: BLE Blinky Application peripherals.
Button assignments
- Button 1: Toggle LED on all connected peripherals.
Testing
Test the BLE Multi-link Example application by performing the following steps:
- Compile and program the peripheral application ( Experimental: BLE Blinky Client Application Example ) on two boards.
- This means they are advertising and are waiting for the central device to connect.
- Compile and program the central application onto a third board.
- As soon as the central application is programmed, it starts scanning and attempts to connect to the peripherals and enable notifications. On all three boards, LED 2 is on. This shows that they are in a connection.
- Press button 1 on the central board. Observe that LED 3 on the peripheral boards turn on.
- For each of the peripherals, press button 1 on the peripheral. Observe that LED 3 on the central turns on.