Developing with ZBOSS for Zigbee
Add group command definitions

Data Structures

struct  zb_zcl_groups_add_group_req_s
 Add group command structure. More...
 
struct  zb_zcl_groups_add_group_res_s
 Add group response command structure. More...
 

Macros

#define ZB_ZCL_GROUPS_GET_ADD_GROUP_REQ(data_buf, add_group_req)
 Parses Add group command and fills in data request structure. If request contains invalid data, ZB_ZCL_NULL_ID is stored as group_id. More...
 
#define ZB_ZCL_GROUPS_GET_ADD_GROUP_RES(data_buf, add_group_res)
 Parses Add group response command and returns response data structure or NULL if request contains invalid data. More...
 
#define ZB_ZCL_GROUPS_SEND_ADD_GROUP_REQ( buffer, addr, dst_addr_mode, dst_ep, ep, prfl_id, def_resp, cb, group_id)
 Send Add group command. More...
 

Typedefs

typedef struct zb_zcl_groups_add_group_req_s zb_zcl_groups_add_group_req_t
 Add group command structure.
 
typedef struct zb_zcl_groups_add_group_res_s zb_zcl_groups_add_group_res_t
 Add group response command structure.
 

Detailed Description

Add group request and response commands have simple payload. Response command is being filled and sent by ZCL internals.

Examples

Filling and sending Add Group request:

ZB_ZCL_GROUPS_SEND_ADD_GROUP_REQ(buffer, DST_ADDR, DST_ADDR_MODE, ENDPOINT_C, ENDPOINT_ED, ZB_AF_HA_PROFILE_ID, ZB_ZCL_ENABLE_DEFAULT_RESPONSE, NULL, TEST_GROUP_ID_1);

Parsing Add Group request:

Parsing Add Group response:

ZB_ZCL_GROUPS_GET_ADD_GROUP_RES(buf, add_group_res);

Macro Definition Documentation

◆ ZB_ZCL_GROUPS_GET_ADD_GROUP_REQ

#define ZB_ZCL_GROUPS_GET_ADD_GROUP_REQ (   data_buf,
  add_group_req 
)
Value:
{ \
zb_zcl_groups_add_group_req_t *add_group_req_ptr; \
(add_group_req_ptr) = zb_buf_len(data_buf) >= ZB_ZCL_ADD_GROUP_REQ_SIZE ? \
\
if (add_group_req_ptr) \
{ \
ZB_HTOLE16(&(add_group_req).group_id, &add_group_req_ptr->group_id);\
/* group name currently is not supported - do not check it */ \
} \
else \
{ \
add_group_req.group_id = ZB_ZCL_NULL_ID; \
} \
}

Parses Add group command and fills in data request structure. If request contains invalid data, ZB_ZCL_NULL_ID is stored as group_id.

Parameters
data_buf- pointer to zb_buf_t buffer containing command request data
add_group_req- variable to save command request
Note
data_buf buffer should contain command request payload without ZCL header.

◆ ZB_ZCL_GROUPS_GET_ADD_GROUP_RES

#define ZB_ZCL_GROUPS_GET_ADD_GROUP_RES (   data_buf,
  add_group_res 
)
Value:
{ \
(add_group_res) = zb_buf_len(data_buf) >= ZB_ZCL_ADD_GROUP_RES_SIZE ? \
\
if (add_group_res) \
{ \
ZB_ZCL_HTOLE16_INPLACE(&(add_group_res)->group_id); \
/* group name currently is not supported - do not check it */ \
} \
}

Parses Add group response command and returns response data structure or NULL if request contains invalid data.

Parameters
data_buf- pointer to zb_buf_t buffer containing command response data
add_group_res- out pointer to zb_zcl_groups_add_group_res_t, containing command response record
Note
data_buf buffer should contain response command payload without ZCL header

◆ ZB_ZCL_GROUPS_SEND_ADD_GROUP_REQ

#define ZB_ZCL_GROUPS_SEND_ADD_GROUP_REQ (   buffer,
  addr,
  dst_addr_mode,
  dst_ep,
  ep,
  prfl_id,
  def_resp,
  cb,
  group_id 
)
Value:
{ \
zb_uint8_t* ptr = ZB_ZCL_START_PACKET_REQ(buffer) \
ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_REQ_FRAME_CONTROL(ptr, def_resp) \
ZB_ZCL_CONSTRUCT_COMMAND_HEADER_REQ(ptr, ZB_ZCL_GET_SEQ_NUM(), ZB_ZCL_CMD_GROUPS_ADD_GROUP); \
ZB_ZCL_PACKET_PUT_DATA16_VAL(ptr, (group_id)); \
/* Group name currently is not supported, put empty string */ \
ZB_ZCL_PACKET_PUT_DATA8(ptr, ZB_ZCL_NULL_STRING); \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
buffer, addr, dst_addr_mode, dst_ep, ep, prfl_id, ZB_ZCL_CLUSTER_ID_GROUPS, cb); \
}

Send Add group command.

Parameters
bufferto put packet to
addr- address to send packet to
dst_addr_mode- addressing mode
dst_ep- destination endpoint
ep- sending endpoint
prfl_id- profile identifier
def_resp- enable/disable default response
cb- callback for getting command send status
group_id- group ID to add
ZB_AF_HA_PROFILE_ID
#define ZB_AF_HA_PROFILE_ID
Definition: zboss_api_af.h:287
ZB_ZCL_ENABLE_DEFAULT_RESPONSE
#define ZB_ZCL_ENABLE_DEFAULT_RESPONSE
Definition: zb_zcl_common.h:936
zb_zcl_groups_add_group_req_s
Add group command structure.
Definition: zb_zcl_groups.h:163
ZB_ZCL_GROUPS_GET_ADD_GROUP_RES
#define ZB_ZCL_GROUPS_GET_ADD_GROUP_RES(data_buf, add_group_res)
Parses Add group response command and returns response data structure or NULL if request contains inv...
Definition: zb_zcl_groups.h:224
ZB_ZCL_GROUPS_GET_ADD_GROUP_REQ
#define ZB_ZCL_GROUPS_GET_ADD_GROUP_REQ(data_buf, add_group_req)
Parses Add group command and fills in data request structure. If request contains invalid data,...
Definition: zb_zcl_groups.h:184
ZB_ZCL_GET_SEQ_NUM
#define ZB_ZCL_GET_SEQ_NUM()
Return next sequence number for ZCL frame.
Definition: zb_zcl_common.h:1349
ZB_ZCL_GROUPS_SEND_ADD_GROUP_REQ
#define ZB_ZCL_GROUPS_SEND_ADD_GROUP_REQ( buffer, addr, dst_addr_mode, dst_ep, ep, prfl_id, def_resp, cb, group_id)
Send Add group command.
Definition: zb_zcl_groups.h:247
ZB_ZCL_CMD_GROUPS_ADD_GROUP
@ ZB_ZCL_CMD_GROUPS_ADD_GROUP
Definition: zb_zcl_groups.h:87
ZB_ZCL_CLUSTER_ID_GROUPS
#define ZB_ZCL_CLUSTER_ID_GROUPS
Definition: zb_zcl_common.h:209
zb_zcl_groups_add_group_res_s
Add group response command structure.
Definition: zb_zcl_groups.h:202
zb_buf_begin
#define zb_buf_begin(buf)
Definition: zboss_api_buf.h:344
zb_buf_len
#define zb_buf_len(buf)
Definition: zboss_api_buf.h:362