nRF5 SDK v17.1.0
GATT Service Server Example Application
This example requires the following SoftDevice: S132

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

The GATT Service Application is an example that implements the GATT service using the hardware delivered in the nRF5 Development Kit. This application is used to showcase the Service Changed Characteristic (0x2A05).

The application uses a button to send Service Changed indications to connected peers. If the button was pressed while the devices are not connected, the indication is sent once they reconnect.

This example can be tested together with GATT Service Client Example Application.

Note
This application is not power optimized!

Setup

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

Button assignments: BSP BLE Button Assignments

Testing

  1. Start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
    • Baud rate: 115.200
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: None
  2. Compile and program the application. Observe that the BSP_INDICATE_SCANNING state is indicated.
  3. Program the GATT Service Client Example Application onto a second device. Observe that the BSP_INDICATE_CONNECTED state is indicated once both devices are running.
  4. Press button 3 and observe that Service Changed indication is being logged on the peer device containing the client. An indication confirmation will be logged on the server side.
  5. Disconnect (For example by powering off) one of the devices. Press button 3. Connect the devices again. Observe on the UART that a Service Changed indication is received on the peer device containing the client.
  6. Disconnect again, this time without pressing button 3. Observe that the Service Changed indication is not sent upon reconnecting.

Documentation feedback | Developer Zone | Subscribe | Updated