我的模块是CC2430,协议栈ZStack-1.4.3-1.2.1,可以用下面函数求终端节点的64位物理地址。
void sendIEEE_Addr(void)
{
uint8 i;
uint8 ch;
uint8 *xad;
uint8 sln;
unsigned char lcd_buf[18];
// Display the extended address
xad = (uint8*)&aExtendedAddress + Z_EXTADDR_LEN - 1;
for ( i = 0; i < Z_EXTADDR_LEN*2; xad-- ) {
ch = (*xad >> 4) & 0x0F;
lcd_buf[i++] = ch + (( ch < 10 ) ? '0' : '7');
ch = *xad & 0x0F;
lcd_buf[i++] = ch + (( ch < 10 ) ? '0' : '7');
}
sln = (byte)osal_strlen( (void*)lcd_buf )+1;
if ( AF_DataRequest( &SampleApp_Flash_DstAddr, &SampleApp_epDesc,
SAMPLEAPP_IEEE_Addr_CLUSTERID,
sln,
(uint8 *)lcd_buf,
&SampleApp_TransID,
AF_DISCV_ROUTE,
AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
{
}
}
|