nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches

◆ ble_nus_data_send()

uint32_t ble_nus_data_send ( struct ble_nus * nus,
uint8_t * data,
uint16_t * length,
uint16_t conn_handle )

#include <ble_nus.h>

Send data on the NUS TX characteristic as a notification.

Sends data if the notification bit in the CCCD is set for conn_handle.

Parameters
[in]nusPointer to the Nordic UART Service structure.
[in]dataData to be sent.
[in,out]lengthIn: Length of the data. Out: Number of bytes sent.
[in]conn_handleConnection handle of the destination client.
Return values
NRF_SUCCESSOn success.
NRF_ERROR_NULLIf nus, data, or length are NULL.
NRF_ERROR_INVALID_STATEIf the peer has not enabled TX notifications (CCCD not set for notifications).
Returns
In addition, this function may return any error returned by the following SoftDevice functions:
  • sd_ble_gatts_value_get()
  • sd_ble_gatts_hvx()