Hi,Mario Ignacio Castaneda Lopez,
Thank you very much for your reply!But there are still some unclear points as below Bold and italic characters:
2. If 8 ZEDs have been joined to one coordinator, how can my coordinator application code get the MAC addresses of these 8 ZEDs and their link KEYs(this link KEY is that ZED gets thought ZPS_eAplZdoRequestKeyReq) by the stack API?
We do not provide a specific API to get the MAC address, but You can get if you define
APPSRC += appZpsExtendedDebug.c in the makefile.
Then you can print the tables, for example vDisplayAddressMapTable. Look at the appZpsExtendedDebug.c file.
I use vDisplayAddressMapTable() in the appZpsExtendedDebug.c and app_zbp_utilities.c at the same time to get MAC address of only one ZED,print information is as below:
Address Map Size: 10
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Address Map Size: 10
Short Addr: fffe, u16Lookup: 0, Ext Addr: 00158d0001154d9f,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
vDisplayAddressMapTable() in the appZpsExtendedDebug.c does not print out MAC address of only one ZED, i list their source code below:
vDisplayAddressMapTable() in the appZpsExtendedDebug.c
PUBLIC void vDisplayAddressMapTable(void)
{
ZPS_tsNwkNib * thisNib;
thisNib = ZPS_psNwkNibGetHandle(ZPS_pvAplZdoGetNwkHandle());
uint8 i = 0;
DBG_vPrintf(TRACE_ZBP_UTILS,"\r\nAddress Map Size: %d", thisNib->sTblSize.u16AddrMap);
for( i=0;i<thisNib->sTblSize.u16AddrMap;i++)
{
DBG_vPrintf(TRACE_ZBP_UTILS,"\nShort Addr: %04x, Ext Addr: %016llx,", thisNib->sTbl.pu16AddrMapNwk[i], ZPS_u64NwkNibGetMappedIeeeAddr(ZPS_pvAplZdoGetNwkHandle(),thisNib->sTbl.pu16AddrLookup[i]));
}
}
vDisplayAddressMapTable() in the app_zbp_utilities.c
PUBLIC void vDisplayAddressMapTable_Ut(void)
{
ZPS_tsNwkNib * thisNib;
void * thisNet = ZPS_pvAplZdoGetNwkHandle();
thisNib = ZPS_psNwkNibGetHandle(thisNet);
uint8 i = 0;
DBG_vPrintf(TRACE_ZBP_UTILS,"\r\nUT:Address Map Size: %d", thisNib->sTblSize.u16AddrMap);
for( i=0;i<thisNib->sTblSize.u16AddrMap;i++)
{
DBG_vPrintf(TRACE_ZBP_UTILS,"\nShort Addr: %04x, u16Lookup: %x, Ext Addr: %016llx,", thisNib->sTbl.pu16AddrMapNwk[i], thisNib->sTbl.psNtActv[i].u16Lookup,ZPS_u64NwkNibGetMappedIeeeAddr(thisNet,thisNib->sTbl.psNtActv[i].u16Lookup));
}
}
vDisplayAddressMapTable() in the app_zbp_utilities.c print MAC address of the ZEDs by u16Lookup of the neighbor table, it can not print the MAC addresses of all eight ZEDs if there some ZEDs of eight ZEDs join router in the mesh network , therefore there is still need vDisplayAddressMapTable() to get the MAC addresses of all eight ZEDs in the appZpsExtendedDebug.c
Would you please tell me why vDisplayAddressMapTable() can not print MAC address in the appZpsExtendedDebug.c ?
One other question , i need get TC(trust center) link keys of all eight ZEDs which request to trust center thought ZPS_eAplZdoRequestKeyReq when they joined . It seems to get TC link keys of all eight ZEDs through "ZPS_TclkDescriptorEntry asTclkStruct[ZNC_MAX_TCLK_DEVICES]" from the flash, but there is not a such function to ouput TC link keys through "ZPS_TclkDescriptorEntry asTclkStruct[ZNC_MAX_TCLK_DEVICES]" in the appZpsExtendedDebug.c.
Would you please tell me how to get TC link keys of all eight ZEDs through "ZPS_TclkDescriptorEntry asTclkStruct[ZNC_MAX_TCLK_DEVICES]" from the flash?
3. ZPS_eAplZdoAddReplaceLinkKey( u64DeviceAddress, au8Key, ZPS_APS_UNIQUE_LINK_KEY);
if(bCredPresent)
{
DBG_vPrintf(TRACE_APP, "\nu64Addr:0x%llx has been in the net before",u64DeviceAddress);
asTclkStruct[u16Location].u16TclkRetries = 0xFFFF; What does this 0xFFFF mean?Pleas explain it in detail.
}
The code is checking if the credential is present roll back to confirm that key is used and not install code.
Is the above sentence an explanation for asTclkStruct[u16Location].u16TclkRetries = 0xFFFF ?
4.About bool_t zps_bGetFlashCredential(uint64 u64IeeeAddr,AESSW_Block_u* puKey,uint16 *pu16Index,bool_t ,bool_t bUpdate ) , please tell me means of the bTcCred and the bUpdate or provide the menu documentation for this function.
bTcCred Trust Center Credential and bUpdate update or not.
I still do not understand your explanation to bTcCred and bUpdate, would you tell me more specific:
What does bTcCred=TRUE mean? How to process that function(zps_bGetFlashCredential) when bTcCred=TRUE?
What does bTcCred=FALSE mean?How to process that function(zps_bGetFlashCredential) when bTcCred=FALSE?
What does Trust Center Credential ?
What to be update when bUpdate=TRUE? Or how to process that function(zps_bGetFlashCredential) when bUpdate=TRUE?
Would you tell me more specific for above all question(2,3,4)!