|
Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
|
#include <zephyr/bluetooth/uuid.h>#include <zephyr/bluetooth/services/nus/inst.h>#include <zephyr/sys/slist.h>Go to the source code of this file.
Data Structures | |
| struct | bt_nus_cb |
| Callbacks for getting notified on NUS Service occurrences. More... | |
Macros | |
| #define | BT_UUID_NUS_SRV_VAL BT_UUID_128_ENCODE(0x6e400001, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e) |
| UUIDs of Nordic UART GATT Service. | |
| #define | BT_UUID_NUS_RX_CHAR_VAL BT_UUID_128_ENCODE(0x6e400002, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e) |
| #define | BT_UUID_NUS_TX_CHAR_VAL BT_UUID_128_ENCODE(0x6e400003, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e) |
| #define | BT_NUS_INST_DEFINE(_name) |
| Macro to define instance of NUS Service. | |
Functions | |
| int | bt_nus_inst_cb_register (struct bt_nus_inst *inst, struct bt_nus_cb *cb, void *ctx) |
| NUS server Instance callback register. | |
| int | bt_nus_inst_send (struct bt_conn *conn, struct bt_nus_inst *inst, const void *data, uint16_t len) |
| Send Data to NUS Instance. | |
| static int | bt_nus_cb_register (struct bt_nus_cb *cb, void *ctx) |
| NUS server callback register. | |
| static int | bt_nus_send (struct bt_conn *conn, const void *data, uint16_t len) |
| Send Data over NUS. | |
| #define BT_NUS_INST_DEFINE | ( | _name | ) |
Macro to define instance of NUS Service.
It allows users to define multiple NUS instances, analogous to Serial endpoints, and use each one for different purposes. A default NUS instance may be defined through Kconfig.
| #define BT_UUID_NUS_RX_CHAR_VAL BT_UUID_128_ENCODE(0x6e400002, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e) |
| #define BT_UUID_NUS_SRV_VAL BT_UUID_128_ENCODE(0x6e400001, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e) |
UUIDs of Nordic UART GATT Service.
Service: 6e400001-b5a3-f393-e0a9-e50e24dcca9e RX Char: 6e400002-b5a3-f393-e0a9-e50e24dcca9e TX Char: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
| #define BT_UUID_NUS_TX_CHAR_VAL BT_UUID_128_ENCODE(0x6e400003, 0xb5a3, 0xf393, 0xe0a9, 0xe50e24dcca9e) |
|
inlinestatic |
NUS server callback register.
| cb | Pointer to callbacks structure. Must be valid throughout the lifetime of the application. |
| ctx | User context to be provided through the callback. |
cb is NULL | int bt_nus_inst_cb_register | ( | struct bt_nus_inst * | inst, |
| struct bt_nus_cb * | cb, | ||
| void * | ctx ) |
NUS server Instance callback register.
This function registers callbacks that will be called in certain events related to NUS.
| inst | Pointer to instance of NUS service. NULL if using default instance. |
| cb | Pointer to callbacks structure. Must be valid throughout the lifetime of the application. |
| ctx | User context to be provided through the callback. |
cb is NULL | int bt_nus_inst_send | ( | struct bt_conn * | conn, |
| struct bt_nus_inst * | inst, | ||
| const void * | data, | ||
| uint16_t | len ) |
Send Data to NUS Instance.
| conn | Connection object to send data to. NULL if notifying all peers. |
| inst | Pointer to instance of NUS service. NULL if using default instance. |
| data | Pointer to buffer with bytes to send. |
| len | Length in bytes of data to send. |
Send Data over NUS.
| conn | Connection object to send data to. NULL if notifying all peers. |
| data | Pointer to buffer with bytes to send. |
| len | Length in bytes of data to send. |