Randomize Mac Address in BLE

会有一股神秘感。 提交于 2020-03-04 05:04:10

问题


I have made one app which turns iOS device to beacon. Now when I scan BLE devices from android device I got that iOS device in scan list but issue is every time I got random Mac address.

So, my question is: Is this default behaviour means getting random mac address? I have checked all question on stack overflow and got same answer but still I want to confirm it?

Also, if changing mac address is default behaviour then can we get when mac address changed?

Same for android as well, If my android device works as beacon and if I scan it then still it will rotate my mac address?


回答1:


Whenever advertising BLE, iOS devices will automatically rotate the advertisement packets' MAC address after an unspecified period and conditions.

The exact conditions and frequency in which this happens is undocumented, proprietary, and subject to change at any time by Apple. There is no reliable way to predict when an iOS device will rotate the MAC of an ongoing BLE advertisement, although casual testing shows it often remains stable for minutes at a time.

The only way to know when the MAC changes is to make iOS advertise a known iBeacon identifier that no other device in the vicinity is advertising and track this identifier on Android or another OS that lets you read the raw advertisement's MAC. You can then directly measure when the MAC changes.

The above technique works, but is of limited help in most use cases as it requires two devices in the immediate vicinity and a fixed advertisement by iOS.



来源:https://stackoverflow.com/questions/60504133/randomize-mac-address-in-ble

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!