本帖最后由 wes58 于 2025-4-16 10:32 编辑
If I understand you correctly you want another device that is bound to the Temp. Measurement Server to receive temperature.
In zcl_XXXCb.c there is function App_zclReportCmd(zclReportCmd_t *pReportCmd)
XXX is you project name.
/*********************************************************************
* @fn App_zclReportCmd
*
* @brief Handler for ZCL Report command.
*
* @param pInHdlrMsg - incoming message to process
*
* @return None
*/
//static void App_zclReportCmd(zclReportCmd_t *pReportCmd){
}
By the way, I changed it to zcl_appCb.c so I don't have to change it when I copy the code to a new project
You have to write the code to read the data.
For example I have the following code to read the onOff status that I receive from another device.
static void App_zclReportCmd(zclReportCmd_t *pReportCmd){
zclReportCmd_t *pReportCmd = (zclReportCmd_t *)pInMsg->attrCmd;
for(u8 i = 0; i < pReportCmd->numAttr; i++){
u8 dataType = pReportCmd->attrList.dataType;
if(dataType == ZCL_DATA_TYPE_UINT8){ // ZCL_DATA_TYPE_BOOLEAN){
u8 *state = pReportCmd->attrList.attrData;
u8 status = *state;
if(status == 0){
led_off(LED_GARAGE);
}
else{
led_on(LED_GARAGE);
}
}
}
}
|