Nordic UART Service (NUS)
The Nordic UART Service is a simple GATT-based service with TX and RX characteristics.
Overview
Data received from the peer is passed to the application, and the data received from the application of this service is sent to the peer as Handle Value Notifications. This module demonstrates how to implement a custom GATT-based service and characteristics using the SoftDevice. The service is used by the application to send and receive ASCII text strings to and from the peer.
Configuration
Set the CONFIG_BLE_NUS Kconfig option to enable the service.
Initialization
The service instance is declared using the BLE_NUS_DEF macro, specifying the name of the instance.
The service is initialized by calling the ble_nus_init() function.
See the ble_nus_config struct for configuration details.
Usage
Events from the service are forwarded through the event handler specified during initialization.
For a full list of events, see the ble_nus_evt_type enum.
The application can send data to the peer by calling the ble_nus_data_send() function.
Dependencies
This service has the following Bare Metal dependencies:
SoftDevice (peripheral role) -
CONFIG_SOFTDEVICE_PERIPHERALSoftDevice handler (Bluetooth LE) -
CONFIG_NRF_SDH_BLE
API documentation
include/bm/bluetooth/services/ble_nus.hsubsys/bluetooth/services/ble_nus/