BLE – BLE UART Client
Materials
AmebaD [AMB21 / AMB22 / AMB23 / BW16] x 2
Example
Introduction
In this example, two RTL8722 boards are connected using BLE. One board runs a BLE UART service, while the other connects to the service using a client and both boards are able to communicate with text messages over the UART service.
Procedure
On the first board, upload the BLE UART service example code. Refer to the example guide for detailed instructions.
For the second board, open the example, “Files” -> “Examples” ->
“AmebaBLE” -> “BLEUartClient”
.
Code Reference
The BLEClient class is used to discover the services that exist on a connected BLE device. The discovery process will create BLERemoteService, BLERemoteCharacteristic and BLERemoteDescriptor objects corresponding to the services, characteristics and descriptors that exist on the connected device. These objects can then be used to read and write data to the connected device.