Developing with ZBOSS for Zigbee

Types and macros shared among all attributes' definitions.Use ZB_ZCL_SET_ATTRIBUTE. More...

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_CLUSTER_REVISION_DEFAULT   1
 ZCL 6.0: Default value for cluster revision global attribute, see zcl_attr_global.
 
#define ZB_ZCL_START_DECLARE_ATTRIB_LIST_CLUSTER_REVISION(attrs_desc_name, cluster_name)
 Start declaration of attributes list with cluster revision. More...
 
#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 zb_uint8_t zb_zcl_attr_type_t
 Type for ZCL attribute data type values. More...
 
typedef zb_uint8_t zb_zcl_attr_access_t
 Type for possible values of ZCL attribute access values. More...
 
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)
 

ZCL attribute data type values

Note
The enumeration is not full, and does not contain ZCL types not used in HA profile.
See also
ZCL spec., subclause 2.5.2, Table 2-10. Data Types
#define ZB_ZCL_ATTR_TYPE_NULL   0x00U
 
#define ZB_ZCL_ATTR_TYPE_8BIT   0x08U
 
#define ZB_ZCL_ATTR_TYPE_16BIT   0x09U
 
#define ZB_ZCL_ATTR_TYPE_24BIT   0x0aU
 
#define ZB_ZCL_ATTR_TYPE_32BIT   0x0bU
 
#define ZB_ZCL_ATTR_TYPE_40BIT   0x0cU
 
#define ZB_ZCL_ATTR_TYPE_48BIT   0x0dU
 
#define ZB_ZCL_ATTR_TYPE_56BIT   0x0eU
 
#define ZB_ZCL_ATTR_TYPE_64BIT   0x0fU
 
#define ZB_ZCL_ATTR_TYPE_BOOL   0x10U
 
#define ZB_ZCL_ATTR_TYPE_8BITMAP   0x18U
 
#define ZB_ZCL_ATTR_TYPE_16BITMAP   0x19U
 
#define ZB_ZCL_ATTR_TYPE_24BITMAP   0x1aU
 
#define ZB_ZCL_ATTR_TYPE_32BITMAP   0x1bU
 
#define ZB_ZCL_ATTR_TYPE_40BITMAP   0x1cU
 
#define ZB_ZCL_ATTR_TYPE_48BITMAP   0x1dU
 
#define ZB_ZCL_ATTR_TYPE_56BITMAP   0x1eU
 
#define ZB_ZCL_ATTR_TYPE_64BITMAP   0x1fU
 
#define ZB_ZCL_ATTR_TYPE_U8   0x20U
 
#define ZB_ZCL_ATTR_TYPE_U16   0x21U
 
#define ZB_ZCL_ATTR_TYPE_U24   0x22U
 
#define ZB_ZCL_ATTR_TYPE_U32   0x23U
 
#define ZB_ZCL_ATTR_TYPE_U40   0x24U
 
#define ZB_ZCL_ATTR_TYPE_U48   0x25U
 
#define ZB_ZCL_ATTR_TYPE_U56   0x26U
 
#define ZB_ZCL_ATTR_TYPE_U64   0x27U
 
#define ZB_ZCL_ATTR_TYPE_S8   0x28U
 
#define ZB_ZCL_ATTR_TYPE_S16   0x29U
 
#define ZB_ZCL_ATTR_TYPE_S24   0x2aU
 
#define ZB_ZCL_ATTR_TYPE_S32   0x2bU
 
#define ZB_ZCL_ATTR_TYPE_S40   0x2cU
 
#define ZB_ZCL_ATTR_TYPE_S48   0x2dU
 
#define ZB_ZCL_ATTR_TYPE_S56   0x2eU
 
#define ZB_ZCL_ATTR_TYPE_S64   0x2fU
 
#define ZB_ZCL_ATTR_TYPE_8BIT_ENUM   0x30U
 
#define ZB_ZCL_ATTR_TYPE_16BIT_ENUM   0x31U
 
#define ZB_ZCL_ATTR_TYPE_SEMI   0x38U
 
#define ZB_ZCL_ATTR_TYPE_SINGLE   0x39U
 
#define ZB_ZCL_ATTR_TYPE_DOUBLE   0x3aU
 
#define ZB_ZCL_ATTR_TYPE_OCTET_STRING   0x41U
 
#define ZB_ZCL_ATTR_TYPE_CHAR_STRING   0x42U
 
#define ZB_ZCL_ATTR_TYPE_LONG_OCTET_STRING   0x43U
 
#define ZB_ZCL_ATTR_TYPE_LONG_CHAR_STRING   0x44U
 
#define ZB_ZCL_ATTR_TYPE_ARRAY   0x48U
 
#define ZB_ZCL_ATTR_TYPE_STRUCTURE   0x4cU
 
#define ZB_ZCL_ATTR_TYPE_SET   0x50U
 
#define ZB_ZCL_ATTR_TYPE_BAG   0x51U
 
#define ZB_ZCL_ATTR_TYPE_TIME_OF_DAY   0xe0U
 
#define ZB_ZCL_ATTR_TYPE_DATE   0xe1U
 
#define ZB_ZCL_ATTR_TYPE_UTC_TIME   0xe2U
 
#define ZB_ZCL_ATTR_TYPE_CLUSTER_ID   0xe8U
 
#define ZB_ZCL_ATTR_TYPE_ATTRIBUTE_ID   0xe9U
 
#define ZB_ZCL_ATTR_TYPE_BACNET_OID   0xeaU
 
#define ZB_ZCL_ATTR_TYPE_IEEE_ADDR   0xf0U
 
#define ZB_ZCL_ATTR_TYPE_128_BIT_KEY   0xf1U
 
#define ZB_ZCL_ATTR_TYPE_CUSTOM_32ARRAY   0x4aU
 
#define ZB_ZCL_ATTR_TYPE_INVALID   0xffU
 

ZCL attribute access values

#define ZB_ZCL_ATTR_ACCESS_READ_ONLY   0x01U
 
#define ZB_ZCL_ATTR_ACCESS_WRITE_ONLY   0x02U
 
#define ZB_ZCL_ATTR_ACCESS_READ_WRITE   (ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_WRITE_ONLY)
 
#define ZB_ZCL_ATTR_ACCESS_REPORTING   0x04U
 
#define ZB_ZCL_ATTR_ACCESS_SINGLETON   0x08U
 
#define ZB_ZCL_ATTR_ACCESS_SCENE   0x10U
 
#define ZB_ZCL_ATTR_MANUF_SPEC   0x20U
 
#define ZB_ZCL_ATTR_ACCESS_INTERNAL   0x40U
 

Global attributes that are included to each cluster

See also
ZCL spec - 6.0
#define ZB_ZCL_ATTR_GLOBAL_CLUSTER_REVISION_ID   0xfffdU
 
#define ZB_ZCL_ATTR_GLOBAL_ATTRIBUTE_REPORTING_STATUS_ID   0xfffeU
 

Detailed Description

Types and macros shared among all attributes' definitions.

Use ZB_ZCL_SET_ATTRIBUTE.

Macro Definition Documentation

◆ ZB_ZCL_ATTR_ACCESS_INTERNAL

#define ZB_ZCL_ATTR_ACCESS_INTERNAL   0x40U

ZBOSS Internal access only Attribute

◆ ZB_ZCL_ATTR_ACCESS_READ_WRITE

#define ZB_ZCL_ATTR_ACCESS_READ_WRITE   (ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_WRITE_ONLY)

Attribute is read/write

◆ ZB_ZCL_ATTR_ACCESS_REPORTING

#define ZB_ZCL_ATTR_ACCESS_REPORTING   0x04U

Attribute is allowed for reporting

◆ ZB_ZCL_ATTR_ACCESS_SCENE

#define ZB_ZCL_ATTR_ACCESS_SCENE   0x10U

Attribute is accessed through scene

◆ ZB_ZCL_ATTR_ACCESS_SINGLETON

#define ZB_ZCL_ATTR_ACCESS_SINGLETON   0x08U

Attribute is singleton

◆ ZB_ZCL_ATTR_ACCESS_WRITE_ONLY

#define ZB_ZCL_ATTR_ACCESS_WRITE_ONLY   0x02U

Attribute is write only

◆ ZB_ZCL_ATTR_GLOBAL_ATTRIBUTE_REPORTING_STATUS_ID

#define ZB_ZCL_ATTR_GLOBAL_ATTRIBUTE_REPORTING_STATUS_ID   0xfffeU

Attribute reporting status

◆ ZB_ZCL_ATTR_GLOBAL_CLUSTER_REVISION_ID

#define ZB_ZCL_ATTR_GLOBAL_CLUSTER_REVISION_ID   0xfffdU

Cluster revision

◆ ZB_ZCL_ATTR_MANUF_SPEC

#define ZB_ZCL_ATTR_MANUF_SPEC   0x20U

Attribute is manufacturer specific

◆ ZB_ZCL_ATTR_TYPE_128_BIT_KEY

#define ZB_ZCL_ATTR_TYPE_128_BIT_KEY   0xf1U

128-bit security key

◆ ZB_ZCL_ATTR_TYPE_16BIT

#define ZB_ZCL_ATTR_TYPE_16BIT   0x09U

16-bit value data type

◆ ZB_ZCL_ATTR_TYPE_16BIT_ENUM

#define ZB_ZCL_ATTR_TYPE_16BIT_ENUM   0x31U

16-bit enumeration (U16 discrete) data type

◆ ZB_ZCL_ATTR_TYPE_16BITMAP

#define ZB_ZCL_ATTR_TYPE_16BITMAP   0x19U

16-bit bitmap data type

◆ ZB_ZCL_ATTR_TYPE_24BIT

#define ZB_ZCL_ATTR_TYPE_24BIT   0x0aU

24-bit value data type

◆ ZB_ZCL_ATTR_TYPE_24BITMAP

#define ZB_ZCL_ATTR_TYPE_24BITMAP   0x1aU

24-bit bitmap data type

◆ ZB_ZCL_ATTR_TYPE_32BIT

#define ZB_ZCL_ATTR_TYPE_32BIT   0x0bU

32-bit value data type

◆ ZB_ZCL_ATTR_TYPE_32BITMAP

#define ZB_ZCL_ATTR_TYPE_32BITMAP   0x1bU

32-bit bitmap data type

◆ ZB_ZCL_ATTR_TYPE_40BIT

#define ZB_ZCL_ATTR_TYPE_40BIT   0x0cU

40-bit value data type

◆ ZB_ZCL_ATTR_TYPE_40BITMAP

#define ZB_ZCL_ATTR_TYPE_40BITMAP   0x1cU

40-bit bitmap data type

◆ ZB_ZCL_ATTR_TYPE_48BIT

#define ZB_ZCL_ATTR_TYPE_48BIT   0x0dU

48-bit value data type

◆ ZB_ZCL_ATTR_TYPE_48BITMAP

#define ZB_ZCL_ATTR_TYPE_48BITMAP   0x1dU

48-bit bitmap data type

◆ ZB_ZCL_ATTR_TYPE_56BIT

#define ZB_ZCL_ATTR_TYPE_56BIT   0x0eU

56-bit value data type

◆ ZB_ZCL_ATTR_TYPE_56BITMAP

#define ZB_ZCL_ATTR_TYPE_56BITMAP   0x1eU

56-bit bitmap data type

◆ ZB_ZCL_ATTR_TYPE_64BIT

#define ZB_ZCL_ATTR_TYPE_64BIT   0x0fU

64-bit value data type

◆ ZB_ZCL_ATTR_TYPE_64BITMAP

#define ZB_ZCL_ATTR_TYPE_64BITMAP   0x1fU

64-bit bitmap data type

◆ ZB_ZCL_ATTR_TYPE_8BIT

#define ZB_ZCL_ATTR_TYPE_8BIT   0x08U

8-bit value data type

◆ ZB_ZCL_ATTR_TYPE_8BIT_ENUM

#define ZB_ZCL_ATTR_TYPE_8BIT_ENUM   0x30U

8-bit enumeration (U8 discrete) data type

◆ ZB_ZCL_ATTR_TYPE_8BITMAP

#define ZB_ZCL_ATTR_TYPE_8BITMAP   0x18U

8-bit bitmap data type

◆ ZB_ZCL_ATTR_TYPE_ARRAY

#define ZB_ZCL_ATTR_TYPE_ARRAY   0x48U

Array data type 2 + sum of content len

◆ ZB_ZCL_ATTR_TYPE_ATTRIBUTE_ID

#define ZB_ZCL_ATTR_TYPE_ATTRIBUTE_ID   0xe9U

Attribute ID, 2 bytes

◆ ZB_ZCL_ATTR_TYPE_BACNET_OID

#define ZB_ZCL_ATTR_TYPE_BACNET_OID   0xeaU

BACnet OID, 4 bytes

◆ ZB_ZCL_ATTR_TYPE_BAG

#define ZB_ZCL_ATTR_TYPE_BAG   0x51U

Collection:bag, size = sum of len of content

◆ ZB_ZCL_ATTR_TYPE_BOOL

#define ZB_ZCL_ATTR_TYPE_BOOL   0x10U

Boolean data type

◆ ZB_ZCL_ATTR_TYPE_CHAR_STRING

#define ZB_ZCL_ATTR_TYPE_CHAR_STRING   0x42U

Character string (array) data type

◆ ZB_ZCL_ATTR_TYPE_CLUSTER_ID

#define ZB_ZCL_ATTR_TYPE_CLUSTER_ID   0xe8U

Cluster ID, 2 bytes

◆ ZB_ZCL_ATTR_TYPE_CUSTOM_32ARRAY

#define ZB_ZCL_ATTR_TYPE_CUSTOM_32ARRAY   0x4aU

Custom array of 32 elems data type (now is equal to ZB_ZCL_ATTR_TYPE_ARRAY)

◆ ZB_ZCL_ATTR_TYPE_DATE

#define ZB_ZCL_ATTR_TYPE_DATE   0xe1U

Date, 4 bytes

◆ ZB_ZCL_ATTR_TYPE_DOUBLE

#define ZB_ZCL_ATTR_TYPE_DOUBLE   0x3aU

8 byte floating point

◆ ZB_ZCL_ATTR_TYPE_IEEE_ADDR

#define ZB_ZCL_ATTR_TYPE_IEEE_ADDR   0xf0U

IEEE address (U64) type

◆ ZB_ZCL_ATTR_TYPE_INVALID

#define ZB_ZCL_ATTR_TYPE_INVALID   0xffU

Invalid data type

◆ ZB_ZCL_ATTR_TYPE_LONG_CHAR_STRING

#define ZB_ZCL_ATTR_TYPE_LONG_CHAR_STRING   0x44U

Long character string

◆ ZB_ZCL_ATTR_TYPE_LONG_OCTET_STRING

#define ZB_ZCL_ATTR_TYPE_LONG_OCTET_STRING   0x43U

Long octet string

◆ ZB_ZCL_ATTR_TYPE_NULL

#define ZB_ZCL_ATTR_TYPE_NULL   0x00U

Null data type

◆ ZB_ZCL_ATTR_TYPE_OCTET_STRING

#define ZB_ZCL_ATTR_TYPE_OCTET_STRING   0x41U

Octet string data type

◆ ZB_ZCL_ATTR_TYPE_S16

#define ZB_ZCL_ATTR_TYPE_S16   0x29U

Signed 16-bit value data type

◆ ZB_ZCL_ATTR_TYPE_S24

#define ZB_ZCL_ATTR_TYPE_S24   0x2aU

Signed 24-bit value data type

◆ ZB_ZCL_ATTR_TYPE_S32

#define ZB_ZCL_ATTR_TYPE_S32   0x2bU

Signed 32-bit value data type

◆ ZB_ZCL_ATTR_TYPE_S40

#define ZB_ZCL_ATTR_TYPE_S40   0x2cU

Signed 40-bit value data type

◆ ZB_ZCL_ATTR_TYPE_S48

#define ZB_ZCL_ATTR_TYPE_S48   0x2dU

Signed 48-bit value data type

◆ ZB_ZCL_ATTR_TYPE_S56

#define ZB_ZCL_ATTR_TYPE_S56   0x2eU

Signed 56-bit value data type

◆ ZB_ZCL_ATTR_TYPE_S64

#define ZB_ZCL_ATTR_TYPE_S64   0x2fU

Signed 64-bit value data type

◆ ZB_ZCL_ATTR_TYPE_S8

#define ZB_ZCL_ATTR_TYPE_S8   0x28U

Signed 8-bit value data type

◆ ZB_ZCL_ATTR_TYPE_SEMI

#define ZB_ZCL_ATTR_TYPE_SEMI   0x38U

2 byte floating point

◆ ZB_ZCL_ATTR_TYPE_SET

#define ZB_ZCL_ATTR_TYPE_SET   0x50U

Collection:set, size = sum of len of content

◆ ZB_ZCL_ATTR_TYPE_SINGLE

#define ZB_ZCL_ATTR_TYPE_SINGLE   0x39U

4 byte floating point

◆ ZB_ZCL_ATTR_TYPE_STRUCTURE

#define ZB_ZCL_ATTR_TYPE_STRUCTURE   0x4cU

Structure data type 2 + sum of content len

◆ ZB_ZCL_ATTR_TYPE_TIME_OF_DAY

#define ZB_ZCL_ATTR_TYPE_TIME_OF_DAY   0xe0U

Time of day, 4 bytes

◆ ZB_ZCL_ATTR_TYPE_U16

#define ZB_ZCL_ATTR_TYPE_U16   0x21U

Unsigned 16-bit value data type

◆ ZB_ZCL_ATTR_TYPE_U24

#define ZB_ZCL_ATTR_TYPE_U24   0x22U

Unsigned 24-bit value data type

◆ ZB_ZCL_ATTR_TYPE_U32

#define ZB_ZCL_ATTR_TYPE_U32   0x23U

Unsigned 32-bit value data type

◆ ZB_ZCL_ATTR_TYPE_U40

#define ZB_ZCL_ATTR_TYPE_U40   0x24U

Unsigned 40-bit value data type

◆ ZB_ZCL_ATTR_TYPE_U48

#define ZB_ZCL_ATTR_TYPE_U48   0x25U

Unsigned 48-bit value data type

◆ ZB_ZCL_ATTR_TYPE_U56

#define ZB_ZCL_ATTR_TYPE_U56   0x26U

Unsigned 56-bit value data type

◆ ZB_ZCL_ATTR_TYPE_U64

#define ZB_ZCL_ATTR_TYPE_U64   0x27U

Unsigned 64-bit value data type

◆ ZB_ZCL_ATTR_TYPE_U8

#define ZB_ZCL_ATTR_TYPE_U8   0x20U

Unsigned 8-bit value data type

◆ ZB_ZCL_ATTR_TYPE_UTC_TIME

#define ZB_ZCL_ATTR_TYPE_UTC_TIME   0xe2U

UTC Time, 4 bytes

◆ ZB_ZCL_GET_ATTRIBUTE_VAL_16

#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)

◆ ZB_ZCL_GET_ATTRIBUTE_VAL_32

#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)

◆ ZB_ZCL_GET_ATTRIBUTE_VAL_8

#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)

◆ ZB_ZCL_GET_ATTRIBUTE_VAL_S16

#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)

◆ ZB_ZCL_GET_ATTRIBUTE_VAL_S32

#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)

◆ ZB_ZCL_GET_ATTRIBUTE_VAL_S8

#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)

◆ ZB_ZCL_GET_STRING_BEGIN

#define ZB_ZCL_GET_STRING_BEGIN (   _str)    (&((_str)[1]))

Get pointer to first char in the string.

◆ ZB_ZCL_GET_STRING_CHAR_AT

#define ZB_ZCL_GET_STRING_CHAR_AT (   _str,
  _pos 
)    *ZB_ZCL_GET_STRING_REF_AT(_str, _pos)

Get char by specified pos.

◆ ZB_ZCL_GET_STRING_END

#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.

◆ ZB_ZCL_GET_STRING_REF_AT

#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.

◆ ZB_ZCL_SET_ATTRIBUTE

#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.

Parameters
ep- end point number.
cluster_id- cluster identifier.
cluster_role- role (see zcl_cluster_role)
attr_id- attribute identifier.
value_ptr- pointer to new attribute value.
check_access- boolean flag to specify if to perform access check or not.

◆ ZB_ZCL_SET_DIRECTLY_ATTR_VAL16

#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.

Parameters
attr_desc- pointer to an attribute description structure zb_zcl_attr_s.
value- 16-bit value to be set.

◆ ZB_ZCL_SET_DIRECTLY_ATTR_VAL32

#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.

Parameters
attr_desc- pointer to an attribute description structure zb_zcl_attr_s.
value- 32-bit value to be set.

◆ ZB_ZCL_SET_DIRECTLY_ATTR_VAL8

#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.

Parameters
attr_desc- pointer to an attribute description structure zb_zcl_attr_s.
value- 8-bit value to be set.

◆ ZB_ZCL_START_DECLARE_ATTRIB_LIST_CLUSTER_REVISION

#define ZB_ZCL_START_DECLARE_ATTRIB_LIST_CLUSTER_REVISION (   attrs_desc_name,
  cluster_name 
)
Value:
zb_uint16_t cluster_revision_##attrs_desc_name = cluster_name##_CLUSTER_REVISION_DEFAULT; \
zb_zcl_attr_t attrs_desc_name [] = { \
{ \
ZB_ZCL_ATTR_GLOBAL_CLUSTER_REVISION_ID, \
ZB_ZCL_ATTR_TYPE_U16, \
ZB_ZCL_ATTR_ACCESS_READ_ONLY, \
ZB_ZCL_NON_MANUFACTURER_SPECIFIC, \
(void*) &(cluster_revision_##attrs_desc_name) \
},

Start declaration of attributes list with cluster revision.

◆ ZB_ZCL_STATIC_STRING_APPEND_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)

Append C-string to ZCL static string.

◆ ZB_ZCL_STATIC_STRING_APPEND_CHAR

#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.

◆ ZB_ZCL_STRING_APPEND_C_STR

#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.

◆ ZB_ZCL_STRING_CLEAR

#define ZB_ZCL_STRING_CLEAR (   _str)    (_str[0] = 0)

Set size of ZCL Octet String into 0 .

◆ ZB_ZCL_STRING_TO_C_STRING

#define ZB_ZCL_STRING_TO_C_STRING (   _str)
Value:
{ \
zb_uint8_t _len = _str[0]; \
ZB_MEMMOVE(_str, _str + 1, _len); \
_str[_len] = 0; \
}

Turn ZCL Octet string into string with null-term.

Typedef Documentation

◆ zb_zcl_attr_access_t

Type for possible values of ZCL attribute access values.

Holds one of zcl_attr_access. Kept for backward compatibility as zcl_attr_access were declared previously as enum.

◆ zb_zcl_attr_type_t

Type for ZCL attribute data type values.

Deprecated:
holds one of zcl_attr_type. Kept only for backward compatibility as zcl_attr_type were declared previously as enum. Can be removed in future releases.

Function Documentation

◆ zb_zcl_string_append_byte()

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 
)
static

Add single byte to ZCL Octet String.

◆ zb_zcl_string_append_data()

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

Add some data to ZCL Octet String.

zb_uint16_t
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:157