ble mac地址 协议,在BLE中随机分配Mac地址

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?

解决方案

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值