[Beestack and MC1321x] gZbAddrMode16Bit_c addressing

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

[Beestack and MC1321x] gZbAddrMode16Bit_c addressing

1,545 Views
JanellA
Contributor I
Three questions.

1) How does a coordinator obtain the network address of a router?

2) How does a router obtain the network address of the coordinator? (I think this is just 0 by default, but I'm uncertain I understood the document corectly.)

3) How does a router obtain the network address of another router?




I've read through the BSSRM, yet I haven't managed to identify the missing element of using gZbAddrMode16Bit_c addressing necessary to actually transmitting packets between two devices.

I have an NCB as the coordinator which creates a ZigBee networking using ZDO_Start(gStartWithOutNvm_c). Likewise, the routers of the network join the network using ZDO_Start(gStartWithOutNvm_c). There are no endpoints in my network.

To send a datagram on both the Coordinator and Router I am using the addressing configuration:

Code:
  afAddrInfo_t addrInfo;

  //set address information  FLib_MemSet(&addrInfo, 0, sizeof(addrInfo));  Copy2Bytes(addrInfo.dstAddr.aNwkAddr, addressWhereverIGoToWhateverItIs);  addrInfo.dstAddrMode = gZbAddrMode16Bit_c;  addrInfo.dstEndPoint = appEndPoint;  addrInfo.srcEndPoint = appEndPoint;  addrInfo.txOptions = gApsTxOptionNone_c;  addrInfo.radiusCounter = afDefaultRadius_c; //twice the network depth (how far to send packet before packet expires)   //set cluster information  addrInfo.aClusterId[0] = (mDataClusterId_c & 0xFF); //customized cluster  addrInfo.aClusterId[1] = (mDataClusterId_c >> 8);

 





Labels (1)
0 Kudos
2 Replies

357 Views
JanellA
Contributor I
For the record should anyone happen to stumble across this thread with a similar question, I found a crazy workaround to establish a bidirectional connection between a coordinator and a router. (I still haven't figured router to router out.)

Router after a users presses key 1 (commands the mote to join the network)
A) Mote searches for and joins a network created by the Network Coordinator
B) When a ZDPCallback gZDOToAppMgmtZRRunning_c is received, the router immately executes a ASL_MatchDescriptor_req(NULL, gaBroadcastRxOnIdle, AF_FindEndPointDesc(appEndPoint));
C) When a ZDPCallback gMatch_Desc_rsp_c is received, the router sets a timer and sends a "Hello_Ack" to the Coordinator via ZigBee
D) The mote waits until a "Hello_Ack" is received from the coordinator.
E) When a "Hello_Ack" is received the timer is stopped and  BeeAppTask is created (gAppTaskID  = TS_CreateTask(gTsAppTaskPriority_c, BeeAppTask):smileywink:
D*) If a Hello_Ack is not received from the coordinator before the mote timer expries, the mote returns to BeeAppInit.

Network Coordinator after Network Created:
1) BeeAppDataIndication listens for a "Hello_ACK" from a mote
2) When it receives the "Hello_Ack" it immediately executes a ASL_MatchDescriptor_req(NULL, gaBroadcastRxOnIdle, AF_FindEndPointDesc(appEndPoint));
3) When a ZDPCallback gMatch_Desc_rsp_c is received, the coordinator  binds to the device.
4) The Coordinator then sends a "Hello_ACK" to the mote via ZigBee


0 Kudos

357 Views
Mads
Contributor V
Hi Janell,
 
first of all, you should download the ZigBee specification as it answers your questions. The Beestack reference manual describes the BeeStack API but the ZigBee specification describes how ZigBee works. go to www.zigbee.org.
 
To obtain an network address of another node can can use the ZDP requestion called nwk_addr_req. this helps you look up an ieee address in the network. But you should also look into the e.g. using end device bind like the HA demo applications for commisioning. (answer for 1 and 3)
 
the coordinator is ALWAYS called 0x0000.
 
Br,
Mads
0 Kudos