可以根据静态私密地址解析出公共设备地址public device address。
//函数的头文件
/**
* [url=home.php?mod=space&uid=247401]@brief[/url] Resolve an address from bonding information.
*
* @param addrType - device's address type. Reference GAP_ADDR_TYPE_DEFINES in gap.h
* @param pDevAddr - device's address
* @param pResolvedAddr - pointer to buffer to put the resolved address
*
* [url=home.php?mod=space&uid=266161]@return[/url] bonding index (0 - (GAP_BONDINGS_MAX-1) if found,
* GAP_BONDINGS_MAX if not found
*/
extern uint8 GAPBondMgr_ResolveAddr( uint8 addrType, uint8 *pDevAddr, uint8 *pResolvedAddr );
//------------------使用---------------------------------------------------
PRINT( "Connected.. %02x-%02x-%02x-%02x-%02x-%02x,type:%02x\n", event->devAddr[0],event->devAddr[1],event->devAddr[2],\
event->devAddr[3],event->devAddr[4],event->devAddr[5],event->devAddrType);
//GAP_ResolvePrivateAddr( u8 *pIRK, u8 *pAddr );
uint8_t addr[6]={0};
PRINT("GAPBondMgr_ResolveAddr %02x\r\n",
//根据私有可解析地址解析出public device address
GAPBondMgr_ResolveAddr(event->devAddrType,event->devAddr,addr));
for(uint8_t i=0;i<6;i++)
{
PRINT("%02x ",addr[i]);
}
PRINT("\r\n");
|