OGeek|极客世界-中国程序员成长平台

标题: ios - iBeacon : how to get broadcasted beacon power (txPower) [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:14
标题: ios - iBeacon : how to get broadcasted beacon power (txPower)

iBeacons 似乎广播了他们的 txPower 参数(报告 1 米距离处的 RSSI 功率),该参数用于计算 beacon.accuracybeacon.proximity 属性(详情在 iBeacon广告包可以找到here)。

但是,CLBeacon 类似乎没有 txPower 的属性。有没有办法可以使用 Core Location 框架获得 txPower,或者我需要进入 Core Bluetooth?我需要这个的原因是我想尝试自定义信标精度/接近度计算,以实现非常快速的信标即时范围发现。在这种情况下,从 accuracy 反向计算 txPower 是没有帮助的。



Best Answer-推荐答案


很遗憾,您无法使用 CoreLocationCoreBluetooth 以编程方式获取此值。 Apple 使用 CoreBluetooth 阻止对所有 iBeacon 数据的访问(参见我对此的分割 here 。)与 CoreLocation 类似,它根本不会在 CLBeacon 类,如你所见。

既然你说你不能做逆向计算,那么我能想到的唯一其他方法是:

  1. 使用 Android、OSX Mavericks 或 Linux 设备,这些设备对读取此字段没有此类限制。
  2. 在您的 iOS 应用中为您的所有 iBeacon 创建一个查找表(具有唯一的 UUID/主要/次要值与它们的 txPower 值)

上面的选项 2 显然要求您为所有正在测试的 iBeacon 分配唯一标识符。

关于ios - iBeacon : how to get broadcasted beacon power (txPower),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24001702/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4