找回密码
 立即注册

微信扫码登录

查看: 53|回复: 1

Temperature Measurement Client如何接收已绑定的server数据呢

[复制链接]

22

主题

33

回帖

242

积分

华贵铂金

积分
242
发表于 6 天前 | 显示全部楼层 |阅读模式
information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: 8258
SDK及版本: V3.7.1.2_Patch_0001(PR)
请问Temperature Measurement Client已和Temperature Measurement Server进行了绑定,那么server report温度后,在client如何收到report过来的温度呢?

13

主题

51

回帖

325

积分

流光翡翠

积分
325
发表于 4 天前 | 显示全部楼层
本帖最后由 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);
                                }
                        }
                }
}



您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-4-20 02:09 , Processed in 0.091221 second(s), 21 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表