nRF5 SDK v15.0.0
Experimental: Queued Writes Application
This example requires one of the following SoftDevices: S132, S140

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

The Queued Writes Application is an example that demonstrates the use of Queued Writes. It covers the GATT prepare write and execute write operations. The example uses a proprietary Queued Write Service with a single characteristic that supports reliable write operations. The service uses the Queued Writes module to handle prepare and execute write operations.

Before validating that writes have been executed, the service calls the application with the received data. The example application rejects the write operation if the first byte of the received data is 0, and accepts it otherwise.

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

Testing

Test the Queued Writes Application with nRF Connect by performing the following steps:

  1. Compile and program the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
  2. Connect to the device from nRf Connect (the device is advertising as 'Queued_Write'). Observe that the BSP_INDICATE_CONNECTED state is indicated.
  3. In the UART over BLE service, select the UUID:0002 characteristic (No values read). In the value field, put a hexadecimal value starting with 0x00 (for example, 0001020304050607080910111213141516171819202122232425). Click the 'write' button.
  4. In the log pane, observe that the write operation is rejected with the error code INSUFFICIENT AUTHORIZATION.
  5. Perform another write operation on the same characteristic with a first byte that is not zero (for example, 4201020304050607080910111213141516171819202122232425).
  6. Observe that the write is accepted.

Documentation feedback | Developer Zone | Subscribe | Updated