找回密码
 立即注册

微信扫码登录

查看: 245|回复: 6

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

[复制链接]

23

主题

37

回帖

269

积分

华贵铂金

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

13

主题

57

回帖

345

积分

流光翡翠

积分
345
发表于 2025-4-16 10:30:50 | 显示全部楼层
本帖最后由 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);
                                }
                        }
                }
}



23

主题

37

回帖

269

积分

华贵铂金

积分
269
 楼主| 发表于 2025-4-24 08:18:40 | 显示全部楼层
明白了,谢谢!

7

主题

15

回帖

179

积分

荣耀黄金

积分
179
发表于 3 天前 | 显示全部楼层
Hi.

How can I determine the bind and unbind of an external temperature sensor?

13

主题

57

回帖

345

积分

流光翡翠

积分
345
发表于 3 天前 | 显示全部楼层
本帖最后由 wes58 于 2025-5-6 14:39 编辑
Slacky 发表于 2025-5-6 03:37
Hi.

How can I determine the bind and unbind of an external temperature sensor?

Hi,
This is probably translation from Chinese that it doesn't make it clear. So I will write this.
If you want to bind/unbind device you can use ZGC Tool.

Another method (that I use) you can send a ZBHCI message to the gateway (coordinator) like this:
ZBHCI message BIND
550020A4C1385DF0632B3C1B000603A4C138E000329CC601
where:
cmd 550020
Binding device IEEE addr A4C1385DF0632B3C
ep 1B
binding cluster 0006
mode IEEE addr 03
Bind to Device IEEE addr A4C138E000329CC6
ep 01

ZBHCI message UNBIND
550021A4C1385DF0632B3C1B000603A4C138E000329CC601
where:
cmd 550021
A4C1385DF0632B3C
1B
0006
03
A4C138E000329CC6
01

If you want to check what devices are bound to your temperature sensor you can send ZBHCI command to read the binding table of the device.
Check binding table
550031BF8F00
where:
cmd 550031
Ntw. address of the device BF8F
starting index 00

23

主题

37

回帖

269

积分

华贵铂金

积分
269
 楼主| 发表于 前天 17:46 | 显示全部楼层
如何确认绑定成功了呢? 绑定成功后,应用层有callback提示吗?

13

主题

57

回帖

345

积分

流光翡翠

积分
345
发表于 昨天 05:26 | 显示全部楼层
本帖最后由 wes58 于 2025-5-8 09:22 编辑
Rory 发表于 2025-5-7 17:46
如何确认绑定成功了呢? 绑定成功后,应用层有callback提示吗?

You should receive ZBHCI message like this:
55 80 20 00 04 94 16 22 04 00 aa
Byte 9 is the status - 00 - binding success

You can check zbhci.h file and you will find: ZBHCI_CMD_BINDING_RSP = 0x8020
And when you look for it in zbhciCmdProcess.c you will find function  zbhciBindRspPush(void* arg)

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

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-5-9 16:29 , Processed in 0.083820 second(s), 21 queries .

Powered by Telink 隐私政策

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

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