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.