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.

ZCL库的开发,为什么没有数据发出?

我用zcl库做开发,在ZStack-2.5.1a协议栈基础上,对协议栈自带的Light-switch的例子是跑通的,也明白流程,但是用zclGeneral_SendBasicResetFactoryDefaults()函数却不行,我用USB Dongle抓包发现应该是没有发送出去数据(没有抓到包)。

SampleLight和SampleSwitch的配合的例子是跑通的,在Switch例子中用

ZStatus_t zclGeneral_SendOnOff_CmdToggle( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );

这个函数实现Light节点的灯的开关。

然后我增加

ZStatus_t zclGeneral_SendBasicResetFactoryDefaults( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );

这个函数调用(在开关节点),但是没有数据发出,Light节点也收不到数据。

这两个函数的输入参数是一样的类型,所以我是直接将SendOnOff函数里面的参数复制到SendBasicReset的输入参数里的。

我追踪代码也看到调用了AF_DataRequest函数并且在这个函数中调用了stat = APSDE_DataReq( &req );语句,但是抓不到数据包,我判断应该是没有无线数据发出。

不知道是什么原因呢?AF_DataRequest的返回值也是0。

ZStatus_t zclGeneral_SendOnOff_CmdToggle( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );

ZStatus_t zclGeneral_SendBasicResetFactoryDefaults( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );

这两个函数都是在Switch节点通过按键触发调用,两个函数的出入参数是一样的,但是SendBasicReset没有数据发出,Light节点也没有收到数据。