Data Structures | |
| struct | zb_zcl_default_resp_payload_s |
| Default response payload structure. More... | |
Macros | |
| #define | ZB_ZCL_SEND_DEFAULT_RESP_DIRECTION(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, direction) |
| Send default response command with custom Direction. More... | |
| #define | ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, callback) |
| Send default response command and execute callback when it is acknowledged or expired. More... | |
| #define | ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB_NEW(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, callback, aps_secured) |
| #define | ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, manuf_code, direction, callback) |
| Send default response command and execute callback when it's acknowledged or expired. More... | |
| #define | ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP_EXT( _is_broadcast, _delivery_mode, _disable_def_resp, _status, _is_def_resp_frame) |
| check whether command requires default response to be sent More... | |
| #define | ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP(_cmd_info, _status) |
| API call that is used to check if it is needed to send Default response for the command. More... | |
| #define | ZB_ZCL_SEND_DEFAULT_RESP_EXT(_buffer, _dst_addr, _dst_addr_mode, _dst_ep, _src_ep, _prof_id, _cluster_id, _seq_num, _cmd, _status_code, _direction, _is_manuf_specific, _manuf_code, _callback) |
| General API for sending Default response command. More... | |
| #define | ZB_ZCL_SEND_DEFAULT_RESP(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code) |
| Send default response command. More... | |
| #define | ZB_ZCL_SEND_DEFAULT_RESP_NEW(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, aps_secured) |
| #define | ZB_ZCL_SEND_DEFAULT_RESP_MANUF( buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, manuf_code, direction) |
| Send default response command. More... | |
| #define | ZB_ZCL_READ_DEFAULT_RESP(buffer) |
| Default response structured reading. More... | |
Typedefs | |
| typedef struct zb_zcl_default_resp_payload_s | zb_zcl_default_resp_payload_t |
| Default response payload structure. | |
Detailed Description
Default response command is defined in ZCL spec, subclause 2.4.12.
- Example
- Command can be sent like in the following snippet:
Incoming default response can be parsed as following:buf,ZB_ZCL_PARSED_HDR_SHORT_DATA(cmd_info).source.u.short_addr,ZB_ZCL_PARSED_HDR_SHORT_DATA(cmd_info).src_endpoint,ZB_ZCL_PARSED_HDR_SHORT_DATA(cmd_info).dst_endpoint,cmd_info->profile_id,ZB_ZCL_CLUSTER_ID_CUSTOM,cmd_info->seq_number,cmd_info->cmd_id,status);zb_zcl_default_resp_payload_t* payload = ZB_ZCL_READ_DEFAULT_RESP(zcl_cmd_buf);
Macro Definition Documentation
◆ ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP
| #define ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP | ( | _cmd_info, | |
| _status | |||
| ) |
ZB_NWK_IS_ADDRESS_BROADCAST((_cmd_info).addr_data.common_data.dst_addr), \ ZB_APS_FC_GET_DELIVERY_MODE((_cmd_info).addr_data.common_data.fc), \ (_cmd_info).disable_default_response, _status, \ ((_cmd_info).is_common_command && (_cmd_info).cmd_id == ZB_ZCL_CMD_DEFAULT_RESP)) \ && !ZB_ZCL_ADDR_TYPE_IS_GPD((_cmd_info).addr_data.common_data.source.addr_type))#define ZB_NWK_IS_ADDRESS_BROADCAST(addr)Check that address is broadcast. Definition: zboss_api_nwk.h:78
#define ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP_EXT( _is_broadcast, _delivery_mode, _disable_def_resp, _status, _is_def_resp_frame)check whether command requires default response to be sent Definition: zb_zcl_commands.h:436
API call that is used to check if it is needed to send Default response for the command.
- Parameters
-
_cmd_info - variable of zb_zcl_parsed_hdr_t type, containing received command header data _status - status of the handled command
◆ ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP_EXT
| #define ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP_EXT | ( | _is_broadcast, | |
| _delivery_mode, | |||
| _disable_def_resp, | |||
| _status, | |||
| _is_def_resp_frame | |||
| ) |
(!(_is_broadcast) && ((_delivery_mode) == ZB_APS_DELIVERY_UNICAST) && \ (!(_disable_def_resp) || (_status) != ZB_ZCL_STATUS_SUCCESS) \ && !(_is_def_resp_frame))
check whether command requires default response to be sent
Default response is sent if:
- particular response is not sent yet
- original command is NOT broadcast
- disable_default_response is set to FALSE or command status is not Success
- command itself is NOT default response
This is a helper method, use ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP instead
- Parameters
-
_is_broadcast - broadcast bit from NWK header _delivery_mode - delivery mode from APS header _disable_def_resp - Disable Default Response bit from ZCL header _status - status of the handled command _is_def_resp_frame - check for command type
◆ ZB_ZCL_READ_DEFAULT_RESP
| #define ZB_ZCL_READ_DEFAULT_RESP | ( | buffer | ) |
NULL : \ (zb_zcl_default_resp_payload_t*)zb_buf_begin((buffer))); \ { \ zb_zcl_default_resp_payload_t *default_resp_payload = (zb_zcl_default_resp_payload_t*)zb_buf_begin((buffer)); \ default_resp_payload->status = zb_zcl_zcl8_statuses_conversion(default_resp_payload->status); \ }
struct zb_zcl_default_resp_payload_s zb_zcl_default_resp_payload_tDefault response payload structure.
Default response structured reading.
- Parameters
-
buffer - pointer to the message buffer (of type zb_bufid_t) containing payload
- Returns
- pointer to zb_zcl_default_resp_payload_s structure
- Attention
- returned pointer will point to the same data in the buffer thus being valid until buffer data will be overwritten.
◆ ZB_ZCL_SEND_DEFAULT_RESP
| #define ZB_ZCL_SEND_DEFAULT_RESP | ( | buffer, | |
| addr, | |||
| addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| prof_id, | |||
| cluster_id, | |||
| seq_num, | |||
| cmd, | |||
| status_code | |||
| ) |
ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, \ seq_num, cmd, status_code, NULL)#define ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, callback)Send default response command and execute callback when it is acknowledged or expired. Definition: zb_zcl_commands.h:358
Send default response command.
- Parameters
-
buffer - ID zb_bufid_t of a buffer with payload addr - short destination address addr_mode - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported dst_ep - destination end point ep - our end point prof_id - profile identifier cluster_id - cluster identifier seq_num - sequence number cmd - identifier of the command the response is dedicated to status_code - status field for received command
◆ ZB_ZCL_SEND_DEFAULT_RESP_DIRECTION
| #define ZB_ZCL_SEND_DEFAULT_RESP_DIRECTION | ( | buffer, | |
| addr, | |||
| addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| prof_id, | |||
| cluster_id, | |||
| seq_num, | |||
| cmd, | |||
| status_code, | |||
| direction | |||
| ) |
{ \ zb_uint8_t *ptr; \ ptr = ZB_ZCL_START_PACKET(buffer); \ ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL_A( \ ptr, (direction), ZB_U2B(ZB_ZCL_NOT_MANUFACTURER_SPECIFIC)); \ ZB_ZCL_CONSTRUCT_COMMAND_HEADER(ptr, (seq_num), ZB_ZCL_CMD_DEFAULT_RESP); \ *(ptr++) = (cmd); \ *(ptr++) = (status_code); \ ZB_ZCL_FINISH_PACKET((buffer), ptr) \ ZB_ZCL_SEND_COMMAND_SHORT((buffer), (addr), (addr_mode), (dst_ep), (ep), (prof_id), \ (cluster_id), NULL); \ }#define ZB_ZCL_START_PACKET(zbbuf)Initializes zb_buf_t buffer and returns pointer to the beginning of array. Definition: zb_zcl_common.h:1523
#define ZB_ZCL_NOT_MANUFACTURER_SPECIFICDefinition: zb_zcl_common.h:1006
Send default response command with custom Direction.
If you don't want to specify direction explicitly, use ZB_ZCL_SEND_DEFAULT_RESP()
- Parameters
-
buffer - ID zb_bufid_t of a buffer with payload addr - short destination address addr_mode - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported dst_ep - destination end point ep - our end point prof_id - profile identifier cluster_id - cluster identifier seq_num - sequence number cmd - identifier of the command the response is dedicated to status_code - status field for received command direction - direction of the command (see zcl_frame_direction)
◆ ZB_ZCL_SEND_DEFAULT_RESP_EXT
| #define ZB_ZCL_SEND_DEFAULT_RESP_EXT | ( | _buffer, | |
| _dst_addr, | |||
| _dst_addr_mode, | |||
| _dst_ep, | |||
| _src_ep, | |||
| _prof_id, | |||
| _cluster_id, | |||
| _seq_num, | |||
| _cmd, | |||
| _status_code, | |||
| _direction, | |||
| _is_manuf_specific, | |||
| _manuf_code, | |||
| _callback | |||
| ) |
{ \ zb_uint8_t *_ptr; \ _ptr = ZB_ZCL_START_PACKET(_buffer); \ ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL_A(_ptr, (_direction), \ (_is_manuf_specific)); \ ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT(_ptr, (_seq_num), (_is_manuf_specific), (_manuf_code), \ *(_ptr++) = (_cmd); \ *(_ptr++) = (_status_code); \ ZB_ZCL_FINISH_PACKET((_buffer), _ptr) \ ZB_ZCL_SEND_COMMAND_SHORT((_buffer), (_dst_addr), (_dst_addr_mode), (_dst_ep), (_src_ep), \ (_prof_id), (_cluster_id), (_callback)); \ }#define ZB_ZCL_START_PACKET(zbbuf)Initializes zb_buf_t buffer and returns pointer to the beginning of array. Definition: zb_zcl_common.h:1523
General API for sending Default response command.
- Parameters
-
_buffer - zb_bufid_t buffer _dst_addr - 16-bit destination address _dst_addr_mode - destination address mode. Possible values ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT, ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT, ZB_APS_ADDR_MODE_16_ENDP_PRESENT _dst_ep - destination Endpoint number _src_ep - source Endpoint number _prof_id - profile ID _cluster_id - cluster ID _seq_num - transaction sequence number _cmd - command ID _status_code - command status (see zcl_status) _direction - direction of command (see zcl_frame_direction) _is_manuf_specific - flag, equal to 1 if command is manufacturer specific _manuf_code - manufacturer specific code, is taken unto account only if _is_manuf_specific is equal to 1 _callback - pointer to the callback function that will be called when the command is sent
◆ ZB_ZCL_SEND_DEFAULT_RESP_MANUF
| #define ZB_ZCL_SEND_DEFAULT_RESP_MANUF | ( | buffer, | |
| addr, | |||
| addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| prof_id, | |||
| cluster_id, | |||
| seq_num, | |||
| cmd, | |||
| status_code, | |||
| manuf_code, | |||
| direction | |||
| ) |
ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, \ seq_num, cmd, status_code, manuf_code, direction, NULL)#define ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, manuf_code, direction, callback)Send default response command and execute callback when it's acknowledged or expired. Definition: zb_zcl_commands.h:406
Send default response command.
- Parameters
-
buffer - ID zb_bufid_t of a buffer with payload addr - short destination address addr_mode - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported dst_ep - destination end point ep - our end point prof_id - profile identifier cluster_id - cluster identifier seq_num - sequence number cmd - identifier of the command the response is dedicated to status_code - status field for received command manuf_code - manufacturer code direction - direction of command (see zcl_frame_direction)
◆ ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB
| #define ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB | ( | buffer, | |
| addr, | |||
| addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| prof_id, | |||
| cluster_id, | |||
| seq_num, | |||
| cmd, | |||
| status_code, | |||
| manuf_code, | |||
| direction, | |||
| callback | |||
| ) |
{ \ zb_uint8_t * ptr = NULL; \ ptr = ZB_ZCL_START_PACKET(buffer); \ ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL_EXT(ptr, ZB_TRUE, direction); \ ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT(ptr, seq_num, ZB_TRUE, manuf_code, ZB_ZCL_CMD_DEFAULT_RESP); \ *(ptr++) = cmd; \ *(ptr++) = status_code; \ ZB_ZCL_FINISH_PACKET(buffer, ptr) \ ZB_ZCL_SEND_COMMAND_SHORT(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, (callback)); \}#define ZB_ZCL_START_PACKET(zbbuf)Initializes zb_buf_t buffer and returns pointer to the beginning of array. Definition: zb_zcl_common.h:1523
Send default response command and execute callback when it's acknowledged or expired.
If no callback is needed, use ZB_ZCL_SEND_DEFAULT_RESP()
- Parameters
-
buffer - ID zb_bufid_t of a buffer with payload addr - short destination address addr_mode - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported dst_ep - destination end point ep - our end point prof_id - profile identifier cluster_id - cluster identifier seq_num - sequence number cmd - identifier of the command the response is dedicated to status_code - status field for received command manuf_code - manufacturer code direction - direction of the command (see zcl_frame_direction) callback - callback to be executed when command is acknowledged or expired (of type zb_callback_t)
◆ ZB_ZCL_SEND_DEFAULT_RESP_NEW
| #define ZB_ZCL_SEND_DEFAULT_RESP_NEW | ( | buffer, | |
| addr, | |||
| addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| prof_id, | |||
| cluster_id, | |||
| seq_num, | |||
| cmd, | |||
| status_code, | |||
| aps_secured | |||
| ) |
ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB_NEW(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, \ seq_num, cmd, status_code, NULL, aps_secured)
◆ ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB
| #define ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB | ( | buffer, | |
| addr, | |||
| addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| prof_id, | |||
| cluster_id, | |||
| seq_num, | |||
| cmd, | |||
| status_code, | |||
| callback | |||
| ) |
{ \ zb_uint8_t *ptr; \ ptr = ZB_ZCL_START_PACKET(buffer); \ ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL(ptr); \ ZB_ZCL_CONSTRUCT_COMMAND_HEADER(ptr, (seq_num), ZB_ZCL_CMD_DEFAULT_RESP); \ *(ptr++) = (cmd); \ *(ptr++) = (status_code); \ ZB_ZCL_FINISH_PACKET((buffer), ptr) \ ZB_ZCL_SEND_COMMAND_SHORT((buffer), (addr), (addr_mode), (dst_ep), (ep), (prof_id), \ (cluster_id), (callback)); \ }#define ZB_ZCL_START_PACKET(zbbuf)Initializes zb_buf_t buffer and returns pointer to the beginning of array. Definition: zb_zcl_common.h:1523
Send default response command and execute callback when it is acknowledged or expired.
If no callback is needed, use ZB_ZCL_SEND_DEFAULT_RESP()
- Parameters
-
buffer - ID zb_bufid_t of a buffer with payload addr - short destination address addr_mode - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported dst_ep - destination end point ep - our end point prof_id - profile identifier cluster_id - cluster identifier seq_num - sequence number cmd - identifier of the command the response is dedicated to status_code - status field for received command callback - callback to be executed when command is acknowledged or expired (of type zb_callback_t)
◆ ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB_NEW
| #define ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB_NEW | ( | buffer, | |
| addr, | |||
| addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| prof_id, | |||
| cluster_id, | |||
| seq_num, | |||
| cmd, | |||
| status_code, | |||
| callback, | |||
| aps_secured | |||
| ) |
{ \ zb_uint8_t *ptr; \ ptr = ZB_ZCL_START_PACKET(buffer); \ ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL(ptr); \ ZB_ZCL_CONSTRUCT_COMMAND_HEADER(ptr, (seq_num), ZB_ZCL_CMD_DEFAULT_RESP); \ *(ptr++) = (cmd); \ *(ptr++) = (status_code); \ ZB_ZCL_FINISH_N_SEND_PACKET_NEW((buffer), ptr, (addr), (addr_mode), (dst_ep), (ep), (prof_id), \ (cluster_id), (callback), (aps_secured), ZB_FALSE, 0); \ }#define ZB_ZCL_START_PACKET(zbbuf)Initializes zb_buf_t buffer and returns pointer to the beginning of array. Definition: zb_zcl_common.h:1523