| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Experimental: BLE Blinky Client Application Example
This example requires one of the following SoftDevices: S130, S132

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

The BLE Blinky Client Application Example uses the LED Button Service Client. This is a small custom service that is used to read the state of a button from the nRF5 Development board, and to set the state of a LED. The Blinky Client meant to be used together with Experimental: BLE Blinky Application that uses the server implementation LED Button Service Server.

GAP role implemented is the Central role. GATT role implemented is the Client role.

The Blinky Client will scan for a device with the name "Nordic_Blinky" and connect to it. (This is the name of the complementary example Experimental: BLE Blinky Application.) Once connected, a service disovery is performed to identify the handles of the Characteristics on the server. The Blinky Client will then Configure the CCCD of the Button characteristic (0x1524) to receive notifications from it. Whenever a Button notification is received, we trigger LED1 on the Blinky Client Board to reflect the status of the button press. By pressing button 1 on the Blinky Client Board, we send a value to the LED characteristic (0x1525). This will trigger LED1 on the Blinky Server Board to reflect the status of our button.

# Setup

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

Button Assignment:

- Button 1: If connected, Writes the button status (ON/OFF) into the LED characteristic of the server.

LED assignments:

- LED 1: ON When scanning.
- LED 2: ON while in a connection. OFF while scanning.
- LED 3: If connected: Displays notifications (ON/OFF) from the Button characteristic on the server.

The application uses the following UART settings:

- Baud rate: 115.200
- 8 data bits
- 1 stop bit
- No parity
- HW flow control: RTS/CTS

# Testing

Two boards are needed to perform this test:

- Client Board: nRF5 development board containing the S13x SoftDevice and the BLE Blinky Client application.
- Server Board: nRF5 development board containing the S13x SoftDevice and the BLE Blinky application.

Test the BLE Blinky Client Example application by performing the following steps:

1. Compile the BLE Blinky Client Example application and program both SoftDevice and application on the Client Board.
2. On the Client board, observe that LED 1 is on. This shows that the application is scanning for a a Blinky Server.
3. Compile the BLE blinky Server Example application and program both SoftDevice and application on the Server Board.
4. Observe that the two boards connect to each other (LED 1 will go off, LED 2 will go on).
5. Press button 1 on the Client Board and Observe that LED 3 on the Server board is on for the duration of the press.
6. Press button 1 on the Server Board and Observe that LED 3 on the Client board is on for the duration of the press.