JN5189 Sleeping node and non-sleeping node

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

JN5189 Sleeping node and non-sleeping node

1,067件の閲覧回数
Viki
Contributor II

Hi All,

I have implemented the function of sleeping node receiving data from parent node based on the Zigbee_ed_rx_off routine of SDK2.6.2_JN5189DK6. The modification is to set the Sleeping option in ZPSCFG file to true.
But now I want to put the sleep terminal and the normal terminal in the same set of code, using serial commands to switch the role of the device as the sleep terminal or the normal terminal.My question is:
(1) What are the differences between zigbee_ed_rx_off and zigbee_ed_rx_on codes?
(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?
 
Thank you for your time!
0 件の賞賛
返信
1 返信

1,060件の閲覧回数
mario_castaneda
NXP TechSupport
NXP TechSupport

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