nRF5 SDK for Thread and Zigbee v3.0.0
Data Structures | Macros
ZCL Alarms cluster

Data Structures

struct  zb_zcl_alarms_alarm_table_s
 Format of Alarm table. More...
 
struct  zb_zcl_alarms_reset_alarm_req_s
 Structured representsation of Reset alarm command payload. More...
 
struct  zb_zcl_alarm_get_alarm_hdr_res_s
 
struct  zb_zcl_alarm_get_alarm_res_s
 Get alarm response command structure. More...
 

Macros

#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_ALARMS_ALARM_COUNT_ID(data_ptr)
 
#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_ALARMS_ALARM_TABLE_ID(data_ptr)
 
#define ZB_ZCL_DECLARE_ALARMS_ATTRIB_LIST(attr_list, alarm_count)
 Declare attribute list for Alarms cluster. More...
 
#define ZB_ZCL_ALARMS_REPORT_ATTR_COUNT   0
 

Alarms cluster attributes

enum  zb_zcl_alarms_attr_e { ZB_ZCL_ATTR_ALARMS_ALARM_COUNT_ID = 0x0000, ZB_ZCL_ATTR_ALARMS_ALARM_TABLE_ID = 0xeffe }
 Alarms cluster attribute identifiers. More...
 
typedef struct
zb_zcl_alarms_alarm_table_s 
zb_zcl_alarms_alarm_table_t
 Format of Alarm table. More...
 
#define ZB_ZCL_ALARMS_ALARM_COUNT_DEFAULT_VALUE   0
 Default value for AlarmCount attribute.
 

Alarms cluster commands

enum  zb_zcl_alarms_cmd_e { ZB_ZCL_CMD_ALARMS_RESET_ALARM_ID = 0x00, ZB_ZCL_CMD_ALARMS_RESET_ALL_ALARMS_ID = 0x01, ZB_ZCL_CMD_ALARMS_GET_ALARM_ID = 0x02, ZB_ZCL_CMD_ALARMS_RESET_ALARM_LOG_ID = 0x03 }
 Alarms cluster command identifiers. More...
 
enum  zb_zcl_alarms_cmd_resp_e { ZB_ZCL_CMD_ALARMS_ALARM_ID = 0x00, ZB_ZCL_CMD_ALARMS_GET_ALARM_RES_ID = 0x01 }
 Alarms cluster response command identifiers. More...
 
typedef struct
zb_zcl_alarms_reset_alarm_req_s 
zb_zcl_alarms_reset_alarm_req_t
 Structured representsation of Reset alarm command payload.
 
typedef
zb_zcl_alarms_reset_alarm_req_t 
zb_zcl_alarms_alarm_res_t
 Structured representsation of Alarm command payload.
 
typedef struct
zb_zcl_alarm_get_alarm_hdr_res_s 
zb_zcl_alarm_get_alarm_hdr_res_t
 
typedef struct
zb_zcl_alarm_get_alarm_res_s 
zb_zcl_alarm_get_alarm_res_t
 Get alarm response command structure.
 
#define ZB_ZCL_ALARMS_RESET_ALARM_REQ_PAYLOAD_LEN   sizeof(zb_zcl_alarms_reset_alarm_req_t)
 Reset alarm payload length macro.
 
#define ZB_ZCL_ALARMS_SEND_RESET_ALARM_REQ(buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, dis_default_resp, cb, alarm_code, cluster_id)
 Send Reset alarm command. More...
 
#define ZB_ZCL_ALARMS_GET_RESET_ALARM_REQ(data_buf, reset_alarm_req, status)
 Parses Reset alarm command and fills in data request structure. If request contains invlid data, status will set to ZB_FALSE. More...
 
#define ZB_ZCL_ALARMS_SEND_RESET_ALL_ALARMS_REQ(buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, dis_default_resp, cb)
 Send Reset all alarms command. More...
 
#define ZB_ZCL_ALARMS_SEND_GET_ALARM_REQ(buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, dis_default_resp, cb)
 Send Get alarm command. More...
 
#define ZB_ZCL_ALARMS_SEND_RESET_ALARM_LOG_REQ(buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, dis_default_resp, cb)
 Send Reset alarm log command. More...
 
#define ZB_ZCL_ALARM_GET_ALARM_RES_SIZE   sizeof(zb_zcl_alarm_get_alarm_res_t)
 
#define ZB_ZCL_ALARM_GET_ALARM_HDR_RES_SIZE   sizeof(zb_zcl_alarm_get_alarm_hdr_res_t)
 
#define ZB_ZCL_ALARMS_SEND_ALARM_RES(buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, cb, alarm_code, cluster_id)
 Send Alarm command (to client) More...
 
#define ZB_ZCL_ALARMS_GET_ALARM_RES(data_ptr, buffer, status)
 Parses Reset alarm command and fills in data request structure. If request contains invalid data, status will set to ZB_FALSE. More...
 
#define ZB_ZCL_ALARMS_GET_GET_ALARM_RES(data_buf, get_alarm_res, status)
 Parses Get alarm response command and returns response data structure or status = ZB_FALSE if request contains invlid data. More...
 

Detailed Description

Macro Definition Documentation

#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_ALARMS_ALARM_COUNT_ID (   data_ptr)
Value:
{ \
ZB_ZCL_ATTR_ACCESS_READ_ONLY, \
(zb_voidp_t) data_ptr \
}
Definition: zb_zcl_common.h:461
void * zb_voidp_t
Project-local "pointer to void" type.
Definition: zb_types.h:294
AlarmCount attribute.
Definition: zb_zcl_alarms.h:67
#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_ALARMS_ALARM_TABLE_ID (   data_ptr)
Value:
{ \
ZB_ZCL_ATTR_ALARMS_ALARM_TABLE_ID, \
(zb_voidp_t) data_ptr \
}
Definition: zb_zcl_common.h:504
Definition: zb_zcl_common.h:442
void * zb_voidp_t
Project-local "pointer to void" type.
Definition: zb_types.h:294
#define ZB_ZCL_ALARMS_GET_ALARM_RES (   data_ptr,
  buffer,
  status 
)
Value:
{ \
if (ZB_BUF_LEN((buffer)) != sizeof(zb_zcl_alarms_alarm_res_t)) \
{ \
} \
else \
{ \
(data_ptr)->alarm_code = src_ptr->alarm_code; \
ZB_HTOLE16(&((data_ptr)->cluster_id), &(src_ptr->cluster_id)); \
} \
}
zb_zcl_alarms_reset_alarm_req_t zb_zcl_alarms_alarm_res_t
Structured representsation of Alarm command payload.
Definition: zb_zcl_alarms.h:275
Definition: zb_zcl_common.h:252
#define ZB_BUF_BEGIN(zbbuf)
Definition: zboss_api_core.h:758
#define ZB_BUF_LEN(zbbuf)
Definition: zboss_api_core.h:767
Definition: zb_zcl_common.h:251
Structured representsation of Reset alarm command payload.
Definition: zb_zcl_alarms.h:124

Parses Reset alarm command and fills in data request structure. If request contains invalid data, status will set to ZB_FALSE.

Parameters
data_ptr- pointer to a variable of type zb_zcl_alarms_alarm_res_t.
buffercontaining the packet (by pointer).
status- variable to put parse status to (see zb_zcl_parse_status_t).
#define ZB_ZCL_ALARMS_GET_GET_ALARM_RES (   data_buf,
  get_alarm_res,
  status 
)
Value:
{ \
zb_zcl_alarm_get_alarm_res_t *get_alarm_res_ptr; \
if (ZB_BUF_LEN(data_buf) >= ZB_ZCL_ALARM_GET_ALARM_HDR_RES_SIZE) \
{ \
(get_alarm_res_ptr) = ZB_BUF_BEGIN(data_buf); \
get_alarm_res.status = get_alarm_res_ptr->status; \
if (ZB_BUF_LEN(data_buf) >= ZB_ZCL_ALARM_GET_ALARM_RES_SIZE) \
{ \
get_alarm_res.alarms_code = get_alarm_res_ptr->alarm_code; \
ZB_HTOLE16(&(get_alarm_res).cluster_id, &(get_alarm_res_ptr->cluster_id)); \
ZB_HTOLE32(&(get_alarm_res).timestamp, &(get_alarm_res_ptr->timestamp)); \
} \
status = ZB_TRUE; \
} \
else \
{ \
status = ZB_FALSE; \
} \
}
struct zb_zcl_alarm_get_alarm_res_s zb_zcl_alarm_get_alarm_res_t
Get alarm response command structure.
#define ZB_BUF_BEGIN(zbbuf)
Definition: zboss_api_core.h:758
#define ZB_BUF_LEN(zbbuf)
Definition: zboss_api_core.h:767
Definition: zb_types.h:101
Definition: zb_types.h:100

Parses Get alarm response command and returns response data structure or status = ZB_FALSE if request contains invlid data.

Parameters
data_buf- pointer to zb_buf_t buffer containing command response data
get_alarm_res- command response record
status- variable to put parse status to (see zb_zcl_parse_status_t)
Note
data_buf buffer should contain response command payload without ZCL header
#define ZB_ZCL_ALARMS_GET_RESET_ALARM_REQ (   data_buf,
  reset_alarm_req,
  status 
)
Value:
{ \
zb_zcl_alarms_reset_alarm_req_t *reset_alarm_req_ptr; \
(reset_alarm_req_ptr) = ZB_BUF_LEN(data_buf) >= \
if (reset_alarm_req_ptr) \
{ \
reset_alarm_req.alarm_code = reset_alarm_req_ptr->alarm_code; \
ZB_HTOLE16(&(reset_alarm_req).cluster_id, &(reset_alarm_req_ptr->cluster_id)); \
status = ZB_TRUE; \
} \
else \
{ \
status = ZB_FALSE; \
} \
}
#define ZB_BUF_BEGIN(zbbuf)
Definition: zboss_api_core.h:758
#define ZB_BUF_LEN(zbbuf)
Definition: zboss_api_core.h:767
struct zb_zcl_alarms_reset_alarm_req_s zb_zcl_alarms_reset_alarm_req_t
Structured representsation of Reset alarm command payload.
Structured representsation of Reset alarm command payload.
Definition: zb_zcl_alarms.h:124
Definition: zb_types.h:101
#define ZB_ZCL_ALARMS_RESET_ALARM_REQ_PAYLOAD_LEN
Reset alarm payload length macro.
Definition: zb_zcl_alarms.h:133
Definition: zb_types.h:100

Parses Reset alarm command and fills in data request structure. If request contains invlid data, status will set to ZB_FALSE.

Parameters
data_buf- pointer to zb_buf_t buffer containing command request data
reset_alarm_req- variable to save command request
status- variable to put parse status to (see zb_zcl_parse_status_t).
Note
data_buf buffer should contain command request payload without ZCL header.
#define ZB_ZCL_ALARMS_SEND_ALARM_RES (   buffer,
  addr,
  dst_addr_mode,
  dst_ep,
  ep,
  prof_id,
  cb,
  alarm_code,
  cluster_id 
)
Value:
{ \
ZB_ZCL_PACKET_PUT_DATA8(ptr, (alarm_code)); \
ZB_ZCL_PACKET_PUT_DATA16_VAL(ptr, (cluster_id)); \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, ZB_ZCL_CLUSTER_ID_ALARMS, cb); \
}
#define ZB_ZCL_PACKET_PUT_DATA8(ptr, val)
Put 8 bit value to packet.
Definition: zb_zcl_common.h:1278
#define ZB_ZCL_GET_SEQ_NUM()
Return next sequence number for ZCL frame.
Definition: zb_zcl_common.h:1175
#define ZB_ZCL_START_PACKET(zbbuf)
Initializes zb_buf_t buffer and returns pointer to the beginning of array.
Definition: zb_zcl_common.h:1257
#define ZB_ZCL_CONSTRUCT_COMMAND_HEADER(data_ptr, tsn, cmd_id)
Construct ZCL header.
Definition: zb_zcl_common.h:1132
#define ZB_ZCL_PACKET_PUT_DATA16_VAL(ptr, val)
Definition: zb_zcl_common.h:1296
#define ZB_ZCL_FINISH_PACKET(zbbuf, ptr)
Definition: zb_zcl_common.h:1579
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:116
Definition: zb_zcl_alarms.h:256
Definition: zb_zcl_common.h:145
#define ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_RES_FRAME_CONTROL(buf_ptr)
Construct ZCL header frame control value for cluster-specific command response.
Definition: zb_zcl_common.h:1119

Send Alarm command (to client)

Parameters
bufferto put data to
addr- address of the device to send command to
dst_addr_mode- addressing mode
dst_epdestination endpoint
ep- current endpoint
prof_id- profile identifier
cb- callback to call to report send status
alarm_code- Alarm Code
cluster_id- Cluster Id
#define ZB_ZCL_ALARMS_SEND_GET_ALARM_REQ (   buffer,
  addr,
  dst_addr_mode,
  dst_ep,
  ep,
  prof_id,
  dis_default_resp,
  cb 
)
Value:
{ \
zb_uint8_t* ptr = ZB_ZCL_START_PACKET_REQ(buffer) \
ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_REQ_FRAME_CONTROL(ptr, dis_default_resp) \
ZB_ZCL_CONSTRUCT_COMMAND_HEADER_REQ(ptr, ZB_ZCL_GET_SEQ_NUM(), ZB_ZCL_CMD_ALARMS_GET_ALARM_ID); \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, ZB_ZCL_CLUSTER_ID_ALARMS, cb); \
}
#define ZB_ZCL_GET_SEQ_NUM()
Return next sequence number for ZCL frame.
Definition: zb_zcl_common.h:1175
#define ZB_ZCL_FINISH_PACKET(zbbuf, ptr)
Definition: zb_zcl_common.h:1579
Definition: zb_zcl_alarms.h:119
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:116
Definition: zb_zcl_common.h:145

Send Get alarm command.

Parameters
bufferto put data to
addr- address of the device to send command to
dst_addr_mode- addressing mode
dst_epdestination endpoint
ep- current endpoint
prof_id- profile identifier
dis_default_resp- "Disable default response" flag
cb- callback to call to report send status
#define ZB_ZCL_ALARMS_SEND_RESET_ALARM_LOG_REQ (   buffer,
  addr,
  dst_addr_mode,
  dst_ep,
  ep,
  prof_id,
  dis_default_resp,
  cb 
)
Value:
{ \
zb_uint8_t* ptr = ZB_ZCL_START_PACKET_REQ(buffer) \
ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_REQ_FRAME_CONTROL(ptr, dis_default_resp) \
ZB_ZCL_CONSTRUCT_COMMAND_HEADER_REQ(ptr, ZB_ZCL_GET_SEQ_NUM(), ZB_ZCL_CMD_ALARMS_RESET_ALARM_LOG_ID); \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, ZB_ZCL_CLUSTER_ID_ALARMS, cb); \
}
#define ZB_ZCL_GET_SEQ_NUM()
Return next sequence number for ZCL frame.
Definition: zb_zcl_common.h:1175
Definition: zb_zcl_alarms.h:120
#define ZB_ZCL_FINISH_PACKET(zbbuf, ptr)
Definition: zb_zcl_common.h:1579
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:116
Definition: zb_zcl_common.h:145

Send Reset alarm log command.

Parameters
bufferto put data to
addr- address of the device to send command to
dst_addr_mode- addressing mode
dst_epdestination endpoint
ep- current endpoint
prof_id- profile identifier
dis_default_resp- "Disable default response" flag
cb- callback to call to report send status
#define ZB_ZCL_ALARMS_SEND_RESET_ALARM_REQ (   buffer,
  addr,
  dst_addr_mode,
  dst_ep,
  ep,
  prof_id,
  dis_default_resp,
  cb,
  alarm_code,
  cluster_id 
)
Value:
{ \
zb_uint8_t* ptr = ZB_ZCL_START_PACKET_REQ(buffer) \
ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_REQ_FRAME_CONTROL(ptr, dis_default_resp) \
ZB_ZCL_CONSTRUCT_COMMAND_HEADER_REQ(ptr, ZB_ZCL_GET_SEQ_NUM(), ZB_ZCL_CMD_ALARMS_RESET_ALARM_ID); \
ZB_ZCL_PACKET_PUT_DATA8(ptr, (alarm_code)); \
ZB_ZCL_PACKET_PUT_DATA16_VAL(ptr, (cluster_id)); \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, ZB_ZCL_CLUSTER_ID_ALARMS, cb); \
}
#define ZB_ZCL_PACKET_PUT_DATA8(ptr, val)
Put 8 bit value to packet.
Definition: zb_zcl_common.h:1278
#define ZB_ZCL_GET_SEQ_NUM()
Return next sequence number for ZCL frame.
Definition: zb_zcl_common.h:1175
#define ZB_ZCL_PACKET_PUT_DATA16_VAL(ptr, val)
Definition: zb_zcl_common.h:1296
#define ZB_ZCL_FINISH_PACKET(zbbuf, ptr)
Definition: zb_zcl_common.h:1579
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:116
Definition: zb_zcl_common.h:145
Definition: zb_zcl_alarms.h:117

Send Reset alarm command.

Parameters
bufferto put data to
addr- address of the device to send command to
dst_addr_mode- addressing mode
dst_epdestination endpoint
ep- current endpoint
prof_id- profile identifier
dis_default_resp- "Disable default response" flag
cb- callback to call to report send status
alarm_code- Alarm Code field
cluster_id- Cluster ID field
#define ZB_ZCL_ALARMS_SEND_RESET_ALL_ALARMS_REQ (   buffer,
  addr,
  dst_addr_mode,
  dst_ep,
  ep,
  prof_id,
  dis_default_resp,
  cb 
)
Value:
{ \
zb_uint8_t* ptr = ZB_ZCL_START_PACKET_REQ(buffer) \
ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_REQ_FRAME_CONTROL(ptr, dis_default_resp) \
ZB_ZCL_CONSTRUCT_COMMAND_HEADER_REQ(ptr, ZB_ZCL_GET_SEQ_NUM(), ZB_ZCL_CMD_ALARMS_RESET_ALL_ALARMS_ID); \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, ZB_ZCL_CLUSTER_ID_ALARMS, cb); \
}
#define ZB_ZCL_GET_SEQ_NUM()
Return next sequence number for ZCL frame.
Definition: zb_zcl_common.h:1175
#define ZB_ZCL_FINISH_PACKET(zbbuf, ptr)
Definition: zb_zcl_common.h:1579
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:116
Definition: zb_zcl_alarms.h:118
Definition: zb_zcl_common.h:145

Send Reset all alarms command.

Parameters
bufferto put data to
addr- address of the device to send command to
dst_addr_mode- addressing mode
dst_epdestination endpoint
ep- current endpoint
prof_id- profile identifier
dis_default_resp- "Disable default response" flag
cb- callback to call to report send status
#define ZB_ZCL_DECLARE_ALARMS_ATTRIB_LIST (   attr_list,
  alarm_count 
)
Value:
zb_zcl_alarms_alarm_table_t alarm_table_data_ctx## _attr_list[ZB_ZCL_ALARMS_ALARM_COUNT_MAX_VALUE]; \
ZB_ZCL_START_DECLARE_ATTRIB_LIST(attr_list) \
ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_ALARMS_ALARM_COUNT_ID, (alarm_count)) \
ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_ALARMS_ALARM_TABLE_ID, \
(&(alarm_table_data_ctx## _attr_list))) \
ZB_ZCL_FINISH_DECLARE_ATTRIB_LIST
Format of Alarm table.
Definition: zb_zcl_alarms.h:77
AlarmCount attribute.
Definition: zb_zcl_alarms.h:67

Declare attribute list for Alarms cluster.

Parameters
attr_list- attribure list name
alarm_count- pointer to variable to store AlarmCount attribute value

Typedef Documentation

Format of Alarm table.

See also
ZCL spec, subclause 3.11.2.2

Enumeration Type Documentation

Alarms cluster attribute identifiers.

See also
ZCL spec, subclause 3.11.2.2
Enumerator
ZB_ZCL_ATTR_ALARMS_ALARM_COUNT_ID 

AlarmCount attribute.

Alarms cluster command identifiers.

See also
ZCL spec, subclause 3.11.2.4
Enumerator
ZB_ZCL_CMD_ALARMS_RESET_ALARM_ID 

"Reset alarm" command.

ZB_ZCL_CMD_ALARMS_RESET_ALL_ALARMS_ID 

"Reset all alarms" command.

ZB_ZCL_CMD_ALARMS_GET_ALARM_ID 

"Get alarms" command.

ZB_ZCL_CMD_ALARMS_RESET_ALARM_LOG_ID 

"Reset alarm log" command.

Alarms cluster response command identifiers.

See also
ZCL spec, subclause 3.6.2.3
Enumerator
ZB_ZCL_CMD_ALARMS_ALARM_ID 

Alarm command identifier.

ZB_ZCL_CMD_ALARMS_GET_ALARM_RES_ID 

Get alarm response command identifier.


Documentation feedback | Developer Zone | Subscribe | Updated