大家好、
有人建议我这样做吗?
有时,当我报告属性时,它不会发出。
我创建了一个周期计时器(5s)来发送报告,每次超时处理它都会增加变量(ButCD),而主叫方发送报告(Switch_sendToggle)
似乎不会立即更新属性信息。
静态空 Switch_sendToggle (空)
{
afAddrType_t dstAddr;
zclReportCmd_t *pReportCmd;
//生成 ZCL 温度读数并将其发送到匹配的器件
pReportCmd = iCall_malloc (sizeof (zclReportCmd_t)+ sizeof (zclReport_t));
if (pReportCmd!=空)
{
dstAddr.addrMode =(afAddrMode_t) zswDstAddr.addrMode;
dstAddr.addr.shortAddr = zswDstAddr.addr.shortAddr;
dstAddr.endpoint = zswDstAddr.endpoint;
dstAddr.panId = zswDstAddr.panID;
pReportCmd->numAttr = 1;
pReportCmd->attrList[0].attrID = ATTRID_button_cd;
pReportCmd->atList[0].datatype = ZCL_datatype_uint8;
pReportCmd->attrList[0].attrData =(void *)(&ButCD);
//调用 ZCL 函数发送报告
zcl_SendReportCmd (switch_ep、&dstAddr、
zcl_cluster_ID_Amigo、pReportCmd、
ZCL_FRAME_SERVER_CLIENT_DIR、TRUE、swTransID++);
iCall_free (pReportCmd);
}
}