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.

peripheral设备如何获取centerl设备的PublicAddr



我调试时候发现GAP_LINK_ESTABLISHED_EVENT消息处理中


gapEstLinkReqEvent_t *pPkt = (gapEstLinkReqEvent_t *)pMsg;

if ( pPkt->hdr.status == SUCCESS )
{
VOID osal_memcpy( gapRole_ConnectedDevAddr, pPkt->devAddr, B_ADDR_LEN );

此处pPkt->devAddr并非central设备的PublicAddr?

那么如何获取主设备的PublicAddr呢?

  • Derek,

    这还得取决于central 设备。

    如果central设备本身用的是public 地址的话,那么你得到的肯定就是public 地址。如果用的是random 的话,那么你每次得到都会不一样。

    比如说iOS 设备,用的就是random地址。你可以试一下Android 设备。

  • Yan,您好

    http://www.deyisupport.com/question_answer/wireless_connectivity/bluetooth/f/103/p/52633/143115.aspx#143115

    上面这个帖子跟我的问题一样,我也是想用WhiteList功能,有什么办法让iOS使用自己的PublicAddr作为initAddr么?

  • Derek,

    iOS 无法用public地址作为initAddr.这是由iOS 决定的。貌似苹果也没有公开出来API 能修改这个。

    所以,white list 对iOS 设备无法起作用,没有办法。