Zigbee group addressing

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

Zigbee group addressing

1,724 Views
CecchiSandrone
Contributor II
I'm trying to send data to a ZED group, using Zigbee group addressing.
I used this code for ZEDs to add them to a group:
Code:

uint8_t groupId[2] = {0xFA,0xFA};
void BeeAppInit() {   ......   zbApsmeAddGroupReq_t addGroupRequest; 
       Copy2Bytes(addGroupRequest.aGroupId,groupId);   addGroupRequest.endPoint = 0x01;   (void)APSME_AddGroupRequest(&addGroupRequest);
   ......
}

And in the ZC I used this code to send the message:

Code:

uint8_t groupId[2] = {0xFA,0xFA};
void sendMessage() {

    afAddrInfo_t addrInfo;    addrInfo.dstAddrMode = gZbAddrModeGroup_c;    Copy2Bytes(addrInfo.dstAddr.aNwkAddr,groupId);     addrInfo.dstEndPoint = 0x01;    addrInfo.srcEndPoint = 0x01;    addrInfo.txOptions = gApsTxOptionNone_c;    addrInfo.radiusCounter = afDefaultRadius_c;    Copy2Bytes(addrInfo.aClusterId, appDataCluster);    (void)AF_DataRequest(&addrInfo,10,"Message",NULL);
}

The ZC sends the message when receives a request message from one of the ZEDs.
In my app I have a ZC (with short address 0000) and 2 ZEDs (with short addresses 796F and 7970 respectively).
The problem is that if I turn off one of the 1st ZED (796F) after it has joined with ZC and the other remaining (7970) sends the request message, it doesn't receive any message. It seems (from ZTC log) that the ZC tries to deliver message to 796F first, with no success obviously (because 796F is turned off).

Why is this behavior happening? Maybe did I wrong something in code structure?
Maybe does ZED (796F) must send a NLME-LEAVE message to ZC? However it seems strange that if a ZED i turned off without inform the ZC the network hangs.

Labels (1)
0 Kudos
2 Replies

396 Views
Mads
Contributor V
Hi,
 
You are adding Groups to the stack before you have started it and nvm has been restored, so you code in BeeAppInit Does not have any effect.
 
Set the group after the device has joined the network.
 
BR,
Mads
 
0 Kudos

396 Views
CecchiSandrone
Contributor II
Mads, I've done it in ZDP callback, but however the results remain the same. If I shut down a device of the group, the network hangs.
Code:
zbApsmeAddGroupReq_t addGroupRequest;  switch(event) {    case gMatch_Desc_rsp_c:      pMatchRsp = &(pMsg->msgData.matchDescriptorResponse);      if (pMatchRsp->status == gZbSuccess_c) {        /* remember destination (nwkaddr + endpoint) */        dstEndPoint = pMatchRsp->matchList[0];  /* match to first endpoint */        Copy2Bytes(dstAddr, pMatchRsp->aNwkAddrOfInterest);        LCD_ClearDisplay();        LCD_WriteString(1,(uint8_t *)"ZED started");        LED_SetLed(LED2, gLedOn_c);        Copy2Bytes(addGroupRequest.aGroupId,groupId);        addGroupRequest.endPoint = 0x01;        (void)APSME_AddGroupRequest(&addGroupRequest);      }      break

 

0 Kudos