在zstack中,读取父设备的网络短地址很方便,可以用现成的函数extern uint16 NLME_GetCoordShortAddr( void );,或者直接拷贝osal_memcpy(pValue, &_NIB.nwkCoordAddress, sizeof(uint16));
但是目前我想要读取设备下的子设备的短地址该怎么读呢?
比如有一个协调器,下面连了两个路由,我要如何才能在协调器程序里边读到连接在上面的两个路由的短地址?
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.
如果你知道长地址的话,你可以通过下面函数来做。
afStatus_t ZDP_NwkAddrReq( uint8 *IEEEAddress, byte ReqType,
byte StartIndex, byte SecurityEnable )
如果是子节点的话,入网的时候直接有保存的
在Association list里面读取就可以了,
/*
* Search the Device list using extended Address.
*/
extern associated_devices_t *AssocGetWithExt( byte *extAddr );
信息都保存在AssociatedDevList[x]数组中。