Other Parts Discussed in Thread: Z-STACK
Hi guys,
I have my ZED based on Z-stack 3.0.2
I have NWK_AUTO_POLL enabled
In init function I call: bdb_StartCommissioning(BDB_COMMISSIONING_REJOIN_EXISTING_NETWORK_ON_STARTUP);
and then in:
case BDB_COMMISSIONING_INITIALIZATION:
if(bdbCommissioningModeMsg->bdbCommissioningStatus == BDB_COMMISSIONING_SUCCESS) {
// nothing to do
} else if(bdbCommissioningModeMsg->bdbCommissioningStatus == BDB_COMMISSIONING_NO_NETWORK) {
bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING);
So basically my device tries to join existing network upon startup, if there is any and if not, it tries to join the new one.
This works pretty fine.
But even though I have NWK_AUTO_POLL I would need it to be active only on demand, e.g. when by interrupt I wake up the device for some period of time and then I want it to go sleeping again and stop polling.
I tried to set:
NLME_SetPollRate(0) in my init method - the device was no longer able to join or re-join
then I tried to set
NLME_SetPollRate(0) in
case BDB_COMMISSIONING_NWK_STEERING:
if(bdbCommissioningModeMsg->bdbCommissioningStatus == BDB_COMMISSIONING_SUCCESS)
again, the device was no longer able to join/re-join...
So it seems that wherever I tried to put NLME_SetPollRate(0) it somehow interacted with the comissioning mechanism.
What I would like to have is a device which:
- join/re-join network on startup
- sleeps without polling until pin interrupt comes
- when waken up by interrupt, starts polling e.g. for 30 seconds and then goes to sleep again with no polling.
So I would need your help:
1. how to stop auto polling and especially on which place, so that it does not interact with comissioning procedure?
2. or if it is better other way around - how to start polling only for specified period of time without NWK_AUTO_POLL set
Basically my ZED should be deeply sleeping device, which only needs to poll when I tell it so - for purposes of assisted binding.
Thanks a lot!