This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-CC2652RB: How can I, on an endpoint, receive a Configure Reporting Command issued by a coordinator and respond to it?

Part Number: LP-CC2652RB
Other Parts Discussed in Thread: Z-STACK

I have a temperature sensor and i want to be able to correctly update the reporting time, as desired by the customer via reporting configuration time sent from Home Assistant. If i understand the issue correctly, when i set a new value for reporting time from Home Assistant, that coordinator will issue a Configure Reporting Command with the payload as described by the documentation. Presuming i'm not wrong, i ought to receive this command, unpack the payload and update my internal variables, and then issue a Configure Reporting Command Response back to the stack. Am i wrong?

I tried doing this and, within zclSampleTemperatureSensor_processZStackMsgs i added a new case with zstackmsg_CmdIDs_BDB_REP_ADD_ATTR_CFG_RECORD_DEFAULT_TO_LIST_REQ hoping to cast the incoming message to zstackmsg_bdbRepAddAttrCfgRecordDefaultToListReq_t so i could have access to zstack_bdbRepAddAttrCfgRecordDefaultToListReq_t where repoting times are available. However, it seems that a breakpoint in zstackmsg_CmdIDs_BDB_REP_ADD_ATTR_CFG_RECORD_DEFAULT_TO_LIST_REQ does not trigger, seemingly not being the correct stack message to receive a Configure Reporting Command. 

How can i correctly process the incoming Configure Reporting Command, decode the reporting times and issue a Configure Reporting Command Response back to the stack?

Also, in a generic sense, what is the procedure to issue responses to commands?

  • Hi A V,

    You should not use zstackmsg_CmdIDs_BDB_REP_ADD_ATTR_CFG_RECORD_DEFAULT_TO_LIST_REQ as this is the command ID that the application Zstackapi_bdbRepAddAttrCfgRecordDefaultToListReq passes for the Z-Stack task to handle processBdbRepAddAttrCfgRecordDefaultToListReq.  Instead, you would define ZCL_REPORT and create a zclSampleTemperatureSensor_ProcessInConfigReportCmd function to handle ZCL_CMD_CONFIG_REPORT cases from zclSampleTemperatureSensor_ProcessIncomingMsg.  However, with BDB_REPORTING defined the ZCL layer automatically handles attribute report commands, updates the reporting values, and provides default over-the-air responses.  There should be no need for additional processing from the application layer.  Here is a somewhat similar E2E thread.

    Regards,
    Ryan

  • Hello, Ryan

    Thanks a lot for the response, it makes sense now and will implement things as you said. We've noticed that ZCL handles the processing and response of the commands, but we intend on making a more robust implementation than what most commercially available devices offer and store reporting times in flash to sleep and wake the MCU for energy savings. All other sensors will lose reporting times should a reset or repower happen, reverting back to a default reporting rate.