nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches
Bluetooth LE Nordic UART Service library

Library for handling UART over Bluetooth LE. More...

Data Structures

struct  ble_nus_evt
 Nordic UART Service event structure. More...
 
struct  ble_nus_config
 Nordic UART Service initialization structure. More...
 
struct  ble_nus
 Nordic UART Service structure. More...
 

Macros

#define BLE_NUS_UUID_BASE
 
#define BLE_UUID_NUS_SERVICE   0x0001
 
#define BLE_UUID_NUS_RX_CHARACTERISTIC   0x0002
 
#define BLE_UUID_NUS_TX_CHARACTERISTIC   0x0003
 
#define BLE_NUS_DEF(_name)
 Macro for defining a ble_nus instance.
 
#define BLE_NUS_CONFIG_SEC_MODE_DEFAULT
 Default security configuration.
 
#define BLE_NUS_MAX_DATA_LEN_CALC(mtu_size)
 Macro for calculating maximum length of data (in bytes) that can be transmitted to the peer by the Nordic UART service module, given the ATT MTU size.
 
#define BLE_NUS_MAX_DATA_LEN   BLE_NUS_MAX_DATA_LEN_CALC(CONFIG_NRF_SDH_BLE_GATT_MAX_MTU_SIZE)
 Maximum length of data (in bytes) that can be transmitted to the peer by the Nordic UART service module.
 

Typedefs

typedef void(* ble_nus_evt_handler_t) (struct ble_nus *nus, const struct ble_nus_evt *evt)
 Nordic UART Service event handler type.
 

Enumerations

enum  ble_nus_evt_type {
  BLE_NUS_EVT_RX_DATA , BLE_NUS_EVT_TX_RDY , BLE_NUS_EVT_COMM_STARTED , BLE_NUS_EVT_COMM_STOPPED ,
  BLE_NUS_EVT_ERROR
}
 Nordic UART Service event types. More...
 

Functions

uint32_t ble_nus_init (struct ble_nus *nus, const struct ble_nus_config *nus_config)
 Function for initializing the Nordic UART Service.
 
void ble_nus_on_ble_evt (const ble_evt_t *ble_evt, void *ble_nus)
 Bluetooth LE event handler for the Nordic UART Service.
 
uint32_t ble_nus_data_send (struct ble_nus *nus, uint8_t *data, uint16_t *length, uint16_t conn_handle)
 Send data on the NUS TX characteristic as a notification.
 

Detailed Description

Library for handling UART over Bluetooth LE.