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.

how to use ZDO_STATE_CHANGE

Other Parts Discussed in Thread: CC2530, Z-STACK

Can any one tell how to use ZDO_STATE_CHANGE (cc2530,zstack)

please help

thanks

  • Hi,

    Once device change its state in ZigBee network (e.g., grom DEV_INIT to DEV_END_DEV),

    the ZDO_STATE_CHANGE will be invoked automatically by ZDO.

    Look for it in one of the sample applications and then just add the logic you have in mind.

  • thanks Mr. Sherer,

    In my case( one cordinator and one router) when the cordinator is switched off, router could not identify that and when the router switched off, the cordinator could't identify..i think in both the situations they are not changing state...

    please help 

    thanks..

  • ZDO_STATE_CHANGE is for monitoring device's own state in ZigBee network,

    this wouldn't be affected by the change of the state of another device in the network.

  • Hi Sherer,

    If I am not mistaken,before switching on the cordinator the router will be in orphan state and after switching on the cordinator the router will be the part of the network managed by that cordinator. Now assume that the cordinator is switched off router cannot independly exist and it must go into orphan state.

    When i did this,before switching on the cordinator,router displayed its IEEE address

    When cordinator is on,router is router 1 ,parent 0

    after switching off the cordinator , router still displayind router 1, parent 0

    thanks

    arun

  • Well, you have some sort of confusion, coordinator used to form a network (it may have additional

    functionalities, but for the sake of simplicity let's assume network formation only).

    Once network is formed and it includes routers, taking out coordinator (i.e., switching its power off)

    won't prevent from routers to keep working like nothing happens, perhaps with one exception, issuing

    for new routes discovery, therefore unlike the ZigBee end device, once a parent of a router is unreachable

    (for some reason) the router won't change its networks state to orphan.

    Generally speaking, once network is formed, one can think of coordinator as one of many routers in 

    the network.

    Section 2.2.1 in Z-stack developer's guide.

  • thank you Mr. Sherer

    but cordinator will have the details of all the managed devises in  the binding table(AIB or NIB) . Is it possible to update that table periodically so that from cordinator, an application can know if any of the devices in the network fails.

    thanks

    arun

  • Well, it depends on the amount of nodes in your network, for large numbers

    there's no chance the coordinator based on cc253x device will have sufficient

    RAM for holding binding table that big.

    If you are talking about 20 devices, It is possible.

    Why exactly the need in binding in your project/application?

  • Frankly speaking, I am kindly confused why Z stack needs so many device states. surely you should know device is coordinator, router or End device(And I don't like the way z stack mix the device role with device state), and whether it is offline or on line, but how about

    DEV_INIT, DEV_NWK_DISC, DEV_NWK_JOINING, DEV_NWK_REJOIN, DEV_NWK_ORPHAN,

    perhaps some application needs to know exact what the device is performing its functions right now, but for most, it just follows the standard zigbee scheme, dose it make sense to encapsulate all those networking level details and provides clean state information?

    Since ZDO_STATE_CHANGE is sys msg and needs to be received for all registered task, there could be some redundancy for other task to process those detailed state change

    (after DEV_NWK_DISC, I assume 90% z stack code will go to DEV_NWK_JOINING, how about merge them together?).

    For me, I think it should be done in NWK layer, or at most ZDO.

    Just my two cents.

    Rui

  • hi sherer,

    networking is critical in my application.I want every routers to be in contact with the cordinator always.cordinator broadcasts the packets and routers sends to cordinator with address of 0x0000. It will be a great advantage if i can know the status of routers from the cordinator.

    i have 4 routers and one cordinator. how can i read the binding table or status of routers from cordinator?

    please help

    Thank you

    arun

  • hi   

    It completely depends on the application.these states are not used in most of the applications.

    regards

    arun

  • Hi,

    Before diving into the deep water without proper equipment let's try to clarify a thing or two.

    Is the binding per se essential for your ZigBee network? Have you read and understood

    section 4 in Z-stack developers guide? I'm asking you these questions coz' I'm trying to

    understand the reason you want to use binding in your project/application.

    Secondly, I strongly suggest you to go over the Z-Stack API.pdf, it's is a good place to start too.

  • Did you find the solution for this problem? We are facing the same problem here.

    Thanks,

    Jason

  • HI, Sherer,.

    I think there are some defferences between ZDO_STATE_CHANGE and ZDO_STATE_CHANGE_EVT.

    What you said is similar to ZDO_STATE_CHANGE_EVT, not  ZDO_STATE_CHANGE.

    thanks!

     


  • Hi,
     

    ZDO_STATE_CHANGE_EVT is a name of one of ZDO events

    The ZDO_STATE_CHANGE is a case inside User Application event process loop.

    I do not follow you on this one, could explain please?

  • Hi,

    But this whole thread was not about SAPI.

    Nevertheless, I think we are arguing about two different things. I'll check this

    later. :)

  • Hi sherer,

    I have replied you yesterday.But i can't  see my reply today. 

    Did you see that?

    If not, i well reply again.

    thanks

  • Hi,

    Nope. May be it is somehow related to the new random moderator approval policy?