How to Exchange Data with BeeStack (MC1321X)

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

How to Exchange Data with BeeStack (MC1321X)

1,350 Views
JanellA
Contributor I
Background:
When an SRB connects to the ZigBee network, I need the devices to exchange some additional data before completing the join. This exchange occurs just after the BeeStack ZDO_Start. The exchange itself is spliced into the ZDO_StateMachine. I could move the code to occur just after the StateMachine completes its join cycle. The devides are not yet bound.

I've dug through the code and the BeeStack documentation, but I haven't found anything that allows me to alter the packet payload before the devices are bound. I don't want BeeAppTasks or the binding to occur until after my additional handshaking is completed.

Question:
What functions accept, read, write, and exchange data packets before the devices are bound?




Labels (1)
0 Kudos
2 Replies

501 Views
JanellA
Contributor I
For the record the answer to my condundrum.

For a router, I ended up overriding all of the callbacks of generic app with my own callbacks. (Mine were NetworkJoinDataIndication, NetworkJoinDataConfirm, NetworkJoinZDPCallback, and NetworkJoinKBD.) When the users pressed button1, the motes enters into a custom state machine. This state machine uses the ZDO_StateMachine to join an exisiting network, then uses the ASL to bind to the coordinator, and send a hello_ack to the coordinator. The coordinator, in response to the hello_ack uses the ASL to bind to the mote and then confirms the bind by sending a hello_ack to the mote. Then the mote uses a custom datacluster and datagram to exchange my custom application's configruation information with the coordinator. When the custom exchange is completed, the callbacks are reset and BeeAppTask is created (TS_CreateTask) and the regular application is permitted to run.
0 Kudos

501 Views
Mads
Contributor V
Jannell A,
 
you can not send data before a node has joined the network.
the ZDO state machine ONLY handles the joining and leave and has nothing to do with transmitting data or doing binding, so I can not recommend that you modify anything in it.
Do you modifications in Beeapp.c.
 
Secondly none of the demo application we provide do any kind of binding without you pressing a button, so what you need to re-write is whether you allow the button press to send the binding command.
 
I can only recommend that you read and do the steps in the Beestack Application Development user's guide in order to get some ZigBee programming experience. If you want to learn about how the buttons work then I would recommend that you read and do the steps in the ZigBee Application User's guide first.
 
BR,
Mads
0 Kudos