Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
inst.h File Reference

Go to the source code of this file.

Data Structures

struct  bt_nus_inst

Macros

#define BT_UUID_NUS_SERVICE   BT_UUID_DECLARE_128(BT_UUID_NUS_SRV_VAL)
#define BT_UUID_NUS_TX_CHAR   BT_UUID_DECLARE_128(BT_UUID_NUS_TX_CHAR_VAL)
#define BT_UUID_NUS_RX_CHAR   BT_UUID_DECLARE_128(BT_UUID_NUS_RX_CHAR_VAL)
#define BT_NUS_PERM_WRITE
 Permission for writes to the NUS RX characteristic and CCC; requires encryption if CONFIG_BT_ZEPHYR_NUS_SECURITY_ENCRYPT is enabled, and encryption and authentication if CONFIG_BT_ZEPHYR_NUS_SECURITY_AUTHEN is enabled.
#define BT_NUS_PERM_NOTIFY
 Permission for NUS TX notifications; requires encryption if CONFIG_BT_ZEPHYR_NUS_SECURITY_ENCRYPT is enabled, and encryption and authentication if CONFIG_BT_ZEPHYR_NUS_SECURITY_AUTHEN is enabled.

Functions

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)

Macro Definition Documentation

◆ BT_NUS_PERM_NOTIFY

#define BT_NUS_PERM_NOTIFY
Value:
COND_CODE_1(IS_ENABLED(CONFIG_BT_ZEPHYR_NUS_SECURITY_AUTHEN), (BT_GATT_PERM_READ_AUTHEN), \
(COND_CODE_1(IS_ENABLED(CONFIG_BT_ZEPHYR_NUS_SECURITY_ENCRYPT), \
@ BT_GATT_PERM_READ_ENCRYPT
Attribute read permission with encryption.
Definition gatt.h:62
@ BT_GATT_PERM_NONE
No operations supported, e.g.
Definition gatt.h:50
@ BT_GATT_PERM_READ_AUTHEN
Attribute read permission with authentication.
Definition gatt.h:75
#define IS_ENABLED(config_macro)
Check for macro definition in compiler-visible expressions.
Definition util_macro.h:154
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:209

Permission for NUS TX notifications; requires encryption if CONFIG_BT_ZEPHYR_NUS_SECURITY_ENCRYPT is enabled, and encryption and authentication if CONFIG_BT_ZEPHYR_NUS_SECURITY_AUTHEN is enabled.

◆ BT_NUS_PERM_WRITE

#define BT_NUS_PERM_WRITE
Value:
COND_CODE_1(IS_ENABLED(CONFIG_BT_ZEPHYR_NUS_SECURITY_AUTHEN), (BT_GATT_PERM_WRITE_AUTHEN), \
(COND_CODE_1(IS_ENABLED(CONFIG_BT_ZEPHYR_NUS_SECURITY_ENCRYPT), \
@ BT_GATT_PERM_WRITE
Attribute write permission.
Definition gatt.h:56
@ BT_GATT_PERM_WRITE_ENCRYPT
Attribute write permission with encryption.
Definition gatt.h:68
@ BT_GATT_PERM_WRITE_AUTHEN
Attribute write permission with authentication.
Definition gatt.h:82

Permission for writes to the NUS RX characteristic and CCC; requires encryption if CONFIG_BT_ZEPHYR_NUS_SECURITY_ENCRYPT is enabled, and encryption and authentication if CONFIG_BT_ZEPHYR_NUS_SECURITY_AUTHEN is enabled.

◆ BT_UUID_NUS_RX_CHAR

#define BT_UUID_NUS_RX_CHAR   BT_UUID_DECLARE_128(BT_UUID_NUS_RX_CHAR_VAL)

◆ BT_UUID_NUS_SERVICE

#define BT_UUID_NUS_SERVICE   BT_UUID_DECLARE_128(BT_UUID_NUS_SRV_VAL)

◆ BT_UUID_NUS_TX_CHAR

#define BT_UUID_NUS_TX_CHAR   BT_UUID_DECLARE_128(BT_UUID_NUS_TX_CHAR_VAL)

Function Documentation

◆ nus_bt_chr_write()

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.

◆ nus_ccc_cfg_changed()

void nus_ccc_cfg_changed ( const struct bt_gatt_attr * attr,
uint16_t value )