Hi All,
Hi @Viki,
(1) What are the differences between zigbee_ed_rx_off and zigbee_ed_rx_on codes?
There are two types of End Device, 'RX On' devices, which are always ready to communicate in the network, and sleepy 'RX Off when Idle' End
Devices which can sleep for periods of time during which it can not communicate. The End Device supports the mandatory clusters
and features of the Base Device as defined in the ZigBee Base Device Behavior Specification.
(2) The zigbee_ed_rx_off routine needs to set "sleeping"to TRUE in order to realize the function of sleeping terminal. If "sleeping" is set to TRUE, how to switch to non-sleeping terminal?
Both examples are different, one of them, rx_off, is implementing sleeping and polling routines. for example the switch case in the APP_cbTimerPoll function.
case E_RUNNING:
/* poll for 5 seconds and then schedule regular sleep */
{
if(!bDisallowSleep)
{
u32PollTime++; /* We are polling 250 mSecs */
if(u32PollTime > (5 * 4))
{
/*need to also stop any other timers here too if sleep is intended */
ZTIMER_vStopAllTimers();
u32PollTime = 0;
/*Will wake after 1000 ms if sleep is allowed or you sill get the vWakeCallBack */
memset( &sWake, 0x0, sizeof(PWR_tsWakeTimerEvent));
PWR_eScheduleActivity(&sWake, 1000 , vWakeCallBack);
}
}
}
I recommend look at both examples and implement that routine that you want. However, look at the variable bDisallowSleep that could help you to avoid entering into sleep mode.
Regards,
Mario