Developing with ZBOSS SDK for Zigbee
|
Data Structures | |
struct | zb_zcl_attr_s |
ZCL attribute definition structure. More... | |
Macros | |
#define | ZB_ZCL_SET_STRING_VAL(str, val, len) (ZB_MEMCPY((zb_uint8_t*)(str) + 1, (val), (len)), *(zb_uint8_t*)(str) = (len)) |
Sets correctly ZCL char string value. | |
#define | ZB_ZCL_GET_STRING_LENGTH(str) ((str)[0]) |
Get ZCL string length. | |
#define | ZB_ZCL_SET_STRING_LENGTH(str, _newlen) (((str))[0] = (_newlen)) |
#define | ZB_ZCL_STRING_CONST_SIZE(str) (zb_uint8_t)(sizeof(str) - 1) |
Returns size of a string constant. | |
#define | ZB_ZCL_GET_STRING_BEGIN(_str) (&((_str)[1])) |
#define | ZB_ZCL_GET_STRING_END(_str) (ZB_ZCL_GET_STRING_BEGIN(_str) + ZB_ZCL_GET_STRING_LENGTH(_str)) |
#define | ZB_ZCL_GET_STRING_REF_AT(_str, _pos) (ZB_ZCL_GET_STRING_BEGIN(_str) + _pos) |
#define | ZB_ZCL_GET_STRING_CHAR_AT(_str, _pos) *ZB_ZCL_GET_STRING_REF_AT(_str, _pos) |
#define | ZB_ZCL_STRING_TO_C_STRING(_str) |
#define | ZB_ZCL_STRING_CLEAR(_str) (_str[0] = 0) |
#define | ZB_ZCL_STRING_APPEND_C_STR(_zcl_str, _zcl_str_max_size, _c_str) zb_zcl_string_append_data(_zcl_str, _zcl_str_max_size, (const zb_uint8_t *) _c_str, strlen(_c_str)) |
#define | ZB_ZCL_STATIC_STRING_APPEND_C_STR(_zcl_s_str, _c_str) ZB_ZCL_STRING_APPEND_C_STR((zb_uint8_t *) _zcl_s_str, sizeof(_zcl_s_str), _c_str) |
#define | ZB_ZCL_STATIC_STRING_APPEND_CHAR(_zcl_s_str, _char) zb_zcl_string_append_byte(_zcl_s_str, sizeof(_zcl_s_str), (zb_uint8_t) _char) |
#define | ZB_ZCL_ATTR_SET_WITH_ATTR_ID(_set, _id) ((_set << 8) | (_id & 0xFF)) |
#define | ZB_ZCL_ATTR_SET_WITH_ATTR_ID(_set, _id) ((_set << 8) | (_id & 0xFF)) |
#define | ZB_ZCL_CLUSTER_REVISION_DEFAULT 1 |
ZCL 6.0: Default value for cluster revision global attribute, see zb_zcl_attr_global_e. | |
#define | ZB_ZCL_SET_ATTRIBUTE(ep, cluster_id, cluster_role, attr_id, value_ptr, check_access) |
Sets attribute value, perform all needed checks before and after setting new value, including read-only check and marking for reporting. More... | |
#define | ZB_ZCL_SET_DIRECTLY_ATTR_VAL8(attr_desc, value) |
Set attribute 8-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed. More... | |
#define | ZB_ZCL_SET_DIRECTLY_ATTR_VAL16(attr_desc, value) |
Set attribute 16-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed. More... | |
#define | ZB_ZCL_SET_DIRECTLY_ATTR_VAL32(attr_desc, value) |
Set attribute 32-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed. More... | |
#define | ZB_ZCL_GET_ATTRIBUTE_VAL_8(attr_desc) (*(zb_uint8_t*)attr_desc->data_p) |
#define | ZB_ZCL_GET_ATTRIBUTE_VAL_S8(attr_desc) (*(zb_int8_t*)attr_desc->data_p) |
#define | ZB_ZCL_GET_ATTRIBUTE_VAL_16(attr_desc) (*(zb_uint16_t*)attr_desc->data_p) |
#define | ZB_ZCL_GET_ATTRIBUTE_VAL_S16(attr_desc) (*(zb_int16_t*)attr_desc->data_p) |
#define | ZB_ZCL_GET_ATTRIBUTE_VAL_32(attr_desc) (*(zb_uint32_t*)attr_desc->data_p) |
#define | ZB_ZCL_GET_ATTRIBUTE_VAL_S32(attr_desc) (*(zb_int32_t*)attr_desc->data_p) |
Typedefs | |
typedef enum zb_zcl_attr_type_e | zb_zcl_attr_type_t |
ZCL attribute data type values. More... | |
typedef enum zb_zcl_attr_access_e | zb_zcl_attr_access_t |
ZCL attribute access values. | |
typedef struct zb_zcl_attr_s | zb_zcl_attr_t |
ZCL attribute definition structure. | |
Functions | |
static ZB_INLINE zb_uint16_t | zb_zcl_string_append_data (zb_uint8_t *zcl_str, zb_uint8_t zcl_str_max_size, const zb_uint8_t *c_str, zb_uint8_t c_str_len) |
static ZB_INLINE zb_uint16_t | zb_zcl_string_append_byte (zb_uint8_t *zcl_str, zb_uint8_t zcl_str_max_size, zb_uint8_t value) |
Types and macros shared among all attributes' definitions.
#define ZB_ZCL_GET_ATTRIBUTE_VAL_16 | ( | attr_desc | ) | (*(zb_uint16_t*)attr_desc->data_p) |
Get 16-bit unsigned attribute value (without any check)
#define ZB_ZCL_GET_ATTRIBUTE_VAL_32 | ( | attr_desc | ) | (*(zb_uint32_t*)attr_desc->data_p) |
Get 32-bit unsigned attribute value (without any check)
#define ZB_ZCL_GET_ATTRIBUTE_VAL_8 | ( | attr_desc | ) | (*(zb_uint8_t*)attr_desc->data_p) |
Get 8-bit unsigned attribute value (without any check)
#define ZB_ZCL_GET_ATTRIBUTE_VAL_S16 | ( | attr_desc | ) | (*(zb_int16_t*)attr_desc->data_p) |
Get 16-bit signed attribute value (without any check)
#define ZB_ZCL_GET_ATTRIBUTE_VAL_S32 | ( | attr_desc | ) | (*(zb_int32_t*)attr_desc->data_p) |
Get 32-bit unsigned attribute value (without any check)
#define ZB_ZCL_GET_ATTRIBUTE_VAL_S8 | ( | attr_desc | ) | (*(zb_int8_t*)attr_desc->data_p) |
Get 8-bit signed attribute value (without any check)
#define ZB_ZCL_GET_STRING_BEGIN | ( | _str | ) | (&((_str)[1])) |
Get pointer to first char in the string.
#define ZB_ZCL_GET_STRING_CHAR_AT | ( | _str, | |
_pos | |||
) | *ZB_ZCL_GET_STRING_REF_AT(_str, _pos) |
Get char by specified pos.
#define ZB_ZCL_GET_STRING_END | ( | _str | ) | (ZB_ZCL_GET_STRING_BEGIN(_str) + ZB_ZCL_GET_STRING_LENGTH(_str)) |
Get pointer to (begin + length) char in the string.
#define ZB_ZCL_GET_STRING_REF_AT | ( | _str, | |
_pos | |||
) | (ZB_ZCL_GET_STRING_BEGIN(_str) + _pos) |
Get pointer to char in string at specified pos.
#define ZB_ZCL_SET_ATTRIBUTE | ( | ep, | |
cluster_id, | |||
cluster_role, | |||
attr_id, | |||
value_ptr, | |||
check_access | |||
) |
Sets attribute value, perform all needed checks before and after setting new value, including read-only check and marking for reporting.
ep | - end point number. |
cluster_id | - cluster identifier. |
cluster_role | - role (see zb_zcl_cluster_role_e) |
attr_id | - attribute identifier. |
value_ptr | - pointer to new attribute value. |
check_access | - boolean flag to specify if to perform access check or not. |
#define ZB_ZCL_SET_DIRECTLY_ATTR_VAL16 | ( | attr_desc, | |
value | |||
) |
Set attribute 16-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed.
attr_desc | - pointer to an attribute description structure zb_zcl_attr_s. |
value | - 16-bit value to be set. |
#define ZB_ZCL_SET_DIRECTLY_ATTR_VAL32 | ( | attr_desc, | |
value | |||
) |
Set attribute 32-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed.
attr_desc | - pointer to an attribute description structure zb_zcl_attr_s. |
value | - 32-bit value to be set. |
#define ZB_ZCL_SET_DIRECTLY_ATTR_VAL8 | ( | attr_desc, | |
value | |||
) |
Set attribute 8-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed.
attr_desc | - pointer to an attribute description structure zb_zcl_attr_s. |
value | - 8-bit value to be set. |
#define ZB_ZCL_STATIC_STRING_APPEND_C_STR | ( | _zcl_s_str, | |
_c_str | |||
) | ZB_ZCL_STRING_APPEND_C_STR((zb_uint8_t *) _zcl_s_str, sizeof(_zcl_s_str), _c_str) |
Append C-string to ZCL static string.
#define ZB_ZCL_STATIC_STRING_APPEND_CHAR | ( | _zcl_s_str, | |
_char | |||
) | zb_zcl_string_append_byte(_zcl_s_str, sizeof(_zcl_s_str), (zb_uint8_t) _char) |
Append char to ZCL static string.
#define ZB_ZCL_STRING_APPEND_C_STR | ( | _zcl_str, | |
_zcl_str_max_size, | |||
_c_str | |||
) | zb_zcl_string_append_data(_zcl_str, _zcl_str_max_size, (const zb_uint8_t *) _c_str, strlen(_c_str)) |
Append C-string to ZCL string.
#define ZB_ZCL_STRING_CLEAR | ( | _str | ) | (_str[0] = 0) |
Set size of ZCL Octet String into 0 .
#define ZB_ZCL_STRING_TO_C_STRING | ( | _str | ) |
Turn ZCL Octet string into string with null-term.
typedef enum zb_zcl_attr_type_e zb_zcl_attr_type_t |
ZCL attribute data type values.
enum zb_zcl_attr_access_e |
ZCL attribute access values.
enum zb_zcl_attr_global_e |
enum zb_zcl_attr_type_e |
ZCL attribute data type values.
|
static |
Add single byte to ZCL Octet String.
|
static |
Add some data to ZCL Octet String.