This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
When a Device join into a Network, ZDP Device Announce command will be broadcasted to all over the Network. It is an important message for Network Manager Device.
But when many device are joining into a Network, broadcast message will be sent failed easily. So the Application layer should have chance to retry to send ZDP Device Announce command.
void (*pZdoAnnounceNewAddrFailureCB)(uint8_t status) = NULL; /********************************************************************* * @fn ZDApp_AnnounceNewAddress() * * @brief Send Device Announce and hold all transmissions for * new address timeout. * * @param none * * @return none */ void ZDApp_AnnounceNewAddress( void ) { // Turn off data request hold APSME_HoldDataRequests( 0 ); // new function to send ZDP Device Announce with AF confirm callback afStatus_t status = ZDP_DeviceAnnceEx( NLME_GetShortAddr(), NLME_GetExtAddr(), ZDO_Config_Node_Descriptor.CapabilityFlags, 0, ZDO_AnnounceNewAddrConfirmCB, NULL ); // Trigger callback when Device Announce sent failed, add by luoyiming 2021-05-08 if( status != ZSuccess && pZdoAnnounceNewAddrFailureCB ) { pZdoAnnounceNewAddrFailureCB( status ); } // Setup the timeout APSME_HoldDataRequests( ZDAPP_HOLD_DATA_REQUESTS_TIMEOUT ); if ( ZSTACK_END_DEVICE_BUILD ) { if ( zgChildAgingEnable == TRUE ) { uint8_t coordExtAddr[Z_EXTADDR_LEN]; // Send the message to parent NLME_GetCoordExtAddr( coordExtAddr ); NLME_SendEndDevTimeoutReq( NLME_GetCoordShortAddr(), coordExtAddr, zgEndDeviceTimeoutValue, zgEndDeviceConfiguration ); } } } /********************************************************************* * @fn ZDO_AnnounceNewAddrConfirmCB * * @brief Send Device Announce confirm callback * * @param same with pfnAfCnfCB in af.h * * @return none */ void ZDO_AnnounceNewAddrConfirmCB( uint8_t status, uint8_t endpoint, uint8_t transID, uint16_t clusterID, void* cnfParam ) { // Trigger callback when Device Announce sent failed, add by luoyiming 2021-05-08 if( status != ZSuccess && pZdoAnnounceNewAddrFailureCB ) { pZdoAnnounceNewAddrFailureCB( status ); } }
Just for your reference. It's usually only mandatory to use device announcement when device joins Zigbee network first time as a kick-off point to request details of device information. We usually don't join several devices at the same time so if device announcement is missed, you can just retry to join process.
Zigbee Lights are supplied power by 2 wire. They join into Network together at same time.
I know such case but I still recommend to join those light one by one. Anyway, you are good to have your device announcement retry to improve this.
Hello Aries,
Thank you for providing your solution. As the Zigbee Coordinator acting as Trust Center could also become overloaded with these simultaneous device join requests, it is advisable to stagger the joining devices through a sporadic event (between 0 and 30 seconds) enabled from your application code.
Regards,
Ryan