7#ifndef ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_NUS_INST_H_
8#define ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_NUS_INST_H_
26#define BT_UUID_NUS_SERVICE BT_UUID_DECLARE_128(BT_UUID_NUS_SRV_VAL)
27#define BT_UUID_NUS_TX_CHAR BT_UUID_DECLARE_128(BT_UUID_NUS_TX_CHAR_VAL)
28#define BT_UUID_NUS_RX_CHAR BT_UUID_DECLARE_128(BT_UUID_NUS_RX_CHAR_VAL)
35#define Z_INTERNAL_BT_NUS_INST_DEFINE(_name) \
37BT_GATT_SERVICE_DEFINE(_name##_svc, \
38 BT_GATT_PRIMARY_SERVICE(BT_UUID_NUS_SERVICE), \
39 BT_GATT_CHARACTERISTIC(BT_UUID_NUS_TX_CHAR, \
40 BT_GATT_CHRC_NOTIFY, \
43 BT_GATT_CCC(nus_ccc_cfg_changed, \
44 BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), \
45 BT_GATT_CHARACTERISTIC(BT_UUID_NUS_RX_CHAR, \
46 BT_GATT_CHRC_WRITE | \
47 BT_GATT_CHRC_WRITE_WITHOUT_RESP, \
49 NULL, nus_bt_chr_write, NULL), \
52sys_slist_t _name##_cbs = SYS_SLIST_STATIC_INIT(&_name##_cbs); \
54STRUCT_SECTION_ITERABLE(bt_nus_inst, _name) = { \
55 .svc = &_name##_svc, \
56 .cbs = &_name##_cbs, \
Generic Attribute Profile handling.
struct _slist sys_slist_t
Single-linked list structure.
Definition slist.h:49
ssize_t nus_bt_chr_write(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
Required as the service may be instantiated outside of the module.
void nus_ccc_cfg_changed(const struct bt_gatt_attr *attr, uint16_t value)
__SIZE_TYPE__ ssize_t
Definition types.h:28
flags
Definition parser.h:96
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
GATT Attribute.
Definition gatt.h:224
GATT Service structure.
Definition gatt.h:315
const struct bt_gatt_service_static * svc
Pointer to the NUS Service Instance
Definition inst.h:20
sys_slist_t * cbs
List of subscribers to invoke callbacks on asynchronous events.
Definition inst.h:23