Hi,
I'm having some difficulties understanding how to manage commands in endpoint-specific callbacks.
For example, when receiving a "ZB_ZCL_CMD_CONFIG_REPORT" I'm able to intercept the command by checking the "zb_zcl_parsed_hdr_t" structure.
My doubt is about the correct way to obtain the command fields values (i.e. for reporting configuration the minimum/maximum reporting interval value...).
Another difficulty is that I would like to read a field of the command and then propagate the command to the default handler.
zb_uint8_t processCommandCallback(zb_bufid_t bufid)
{
zb_bufid_t zcl_cmd_buf = bufid;
zb_zcl_parsed_hdr_t *cmd_params = ZB_BUF_GET_PARAM(zcl_cmd_buf, zb_zcl_parsed_hdr_t);
if (cmd_params->cmd_direction == ZB_ZCL_FRAME_DIRECTION_TO_SRV &&
cmd_params->is_common_command &&
cmd_params->cluster_id == <right cluster id> &&
cmd_params->cmd_id == ZB_ZCL_CMD_CONFIG_REPORT)
{
// read minimum reporting value from incoming command for internal usage
}
return ZB_FALSE; // impose ZB_FALSE to propagate command to default handler
}
How can I read the command fields?
Thank you,
Valerio
