Question about ‘OnWithTimedOff’ implemente in JN-AN-1217

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Question about ‘OnWithTimedOff’ implemente in JN-AN-1217

2,059 Views
Tory
Contributor I

I used the function eCLD_OnOffCommandOnWithTimedOffSend to implemente OnWithTimedOff . When I added essential code to the application , a E_CLD_ONOFF_CMD_ON_TIMED_OFF event can be received and the led switched to on ,but it can not switch-off after a timed period. Why?

 

eCLD_OnOffUpdate: OnTime=4 OffWaitTime=5 On=1Update Id 0006

[23:59:23.748]收←◆
eCLD_OnOffUpdate: OnTime=3 OffWaitTime=5 On=1Update Id 0006

[23:59:23.873]收←◆
eCLD_OnOffUpdate: OnTime=2 OffWaitTime=5 On=1Update Id 0006

[23:59:23.951]收←◆
eCLD_OnOffUpdate: OnTime=1 OffWaitTime=5 On=1Update Id 0006

[23:59:24.076]收←◆
eCLD_OnOffUpdate: OnTime=0 OffWaitTime=0 On=0Update Id 0006

Labels (1)
0 Kudos
10 Replies

2,048 Views
nxf56274
NXP Employee
NXP Employee

你的router或者device有没有宏定义CLD_ONOFF_CMD_ON_WITH_TIMED_OFF来开启这个功能?

0 Kudos

2,040 Views
Tory
Contributor I

我目前不清楚的是,计时到期后,是通过什么方式灭灯的,是事件触发还是中断?如果是事件的话,对应的事件是什么?

0 Kudos

2,044 Views
Tory
Contributor I

是的,我在Router 和EndDevice中都使用了这个宏定义,所以目前命令发送成功,接收成功,计时也有,就是计时到期后灯不灭。

0 Kudos

2,017 Views
nxf56274
NXP Employee
NXP Employee

我用的k32w,用的JN-AN-1243(Zigbee 3.0 Base Device Template )作协调器,和jN-AN-1244(Zigbee 3.0 Light Bulbs)做led设备,改的代码,测出来是正常关闭的,你用的应该用的JN板子吧,你改了哪些地方贴个图

0 Kudos

1,993 Views
Tory
Contributor I

EndDevice:

Tory_0-1631751781753.pngTory_1-1631751798334.png

Router:

Tory_2-1631751823066.pngTory_3-1631751832611.png

 

0 Kudos

1,988 Views
nxf56274
NXP Employee
NXP Employee

u8OnOff值为1的时候,是怎样情况

0 Kudos

1,984 Views
Tory
Contributor I

u8OnOff值为1的时候,灯能被点亮,然后就一直亮着。我做了一个测试,加了一个定时器,Router接收到指令后,定时器开始计时,等u16OnTime到期之后,定时器回调函数调用APP_vSetLed( sBaseDevice.sOnOffServerCluster.bOnOff); 灯会熄灭。

也就是说,Router接收到指令,并计时结束后,bOnOff已经更新为0,但没有相应的指令再次调用APP_vSetLed( sBaseDevice.sOnOffServerCluster.bOnOff)这个函数。

Tory_0-1631794005245.pngTory_1-1631794016550.png

 

0 Kudos

1,978 Views
nxf56274
NXP Employee
NXP Employee

JN的sdk没有实现这功能吧,而且sdk也比较老了,我用的就是可以正常点亮关闭的。

0 Kudos

1,958 Views
Tory
Contributor I

找到问题的原因了,不是SDK的问题,是APP_vHandleClusterUpdate()函数内部少了一些代码,导致无法执行APP_vHandleIdentify()。加上这部分代码就OK了。

Tory_0-1631978285232.png

 

0 Kudos

1,965 Views
Tory
Contributor I

猜测应该是SDK没有实现这个功能,谢谢您的帮助。

0 Kudos