Randomize Mac Address in BLE

Shweta Chauhan :

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?

davidgyoung :

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.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=175156&siteId=1