ZigBee stack: responding to device announcements with binding request

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

ZigBee stack: responding to device announcements with binding request

2,309 Views
Elisa
Contributor III
Hi, I'am starting now to work with zigbee.
I am working on a zigbee project  for MC13224 chip.
I'm using Beestack codebase and I need to automate the process of forming the network and binding the corresponding devices, without buttons.
I added ZDO_Start function at the end of BeeAppInit routine in BeeApp.c file, as suggested in this forum and it works.
Now I have to automate the binding request in coordinator (Combined interface).
In fact, if I understood correctly, if coordinator sends ota a binding request end devices automatically responds if their endpoints match with it.
To automate the binding request, can the coordinator respond to end device announcements with a binding request?
How can I do this?
Everything that comes over the air ends up into Zdo_MsgDataCallBack function, before going into Zdp_ResponseHandler or Zdp_ResponseGenerator.
Can I send an event up to application level if cluster id of receiver packet is "=gDevice_annce_c", and start Binding request if there is this event?
Thanks!!!
Elisa
0 Kudos
Reply
2 Replies

795 Views
Elisa
Contributor III

 the Freescale Support wrote me this answer.

 

The answer to your question is yes, you can send your binding request using events when the event occurs. This is good but I suggest you that shot your binding request when the status of the starting network is success: gZDOToAppMgmtZCRunning_c, gZDOToAppMgmtZRRunning_c or gZDOToAppMgmtZEDRunning_c. You can look for this on the ASL_Userinterface.c file (inside the ASL folder) within the ASL_UpdateDevice() function.  Inside that function you will find the next lines:                             

case gZDOToAppMgmtZCRunning_c:
case gZDOToAppMgmtZRRunning_c:
case gZDOToAppMgmtZEDRunning_c:

before the break line of the case sentence you can put the binding request (ASL_EndDeviceBindRequest(NULL,aDestAddress,endPointList[0].pEndpointDesc->pSimpleDesc);
where: aDestAddress is a zbNwkAddr_t type and you can initialize it with the address of the device you want to bind. For examble: zbNwkAddr_t  aDestAddress = {0x00,0x00};

After this in the same function, look for the gBindingSuccess_c case. Before the break of the case and inside the if (appState == mStateBindRequest_c) you should put the next lines:

ASL_ChangeUserInterfaceModeTo(gConfigureMode_c);
ASL_DisplayChangeToCurrentMode(gmUserInterfaceMode);

in order to change from configuration mode to user application mode. Your automatic network formation is ready now, and you can use the free space for your events and not for the network formation events.

Manuel Davalos
Technical Support
Freescale Semiconductor

0 Kudos
Reply

795 Views
Elisa
Contributor III

Sorry for mistake! In order to change from configuration mode to user application mode you have to write


ASL_ChangeUserInterfaceModeTo(gApplicationMode_c);

 

 

Elisa

0 Kudos
Reply