菜鸟教程小白 发表于 2022-12-12 10:14:52

ios - iBeacon : how to get broadcasted beacon power (txPower)


                                            <p><p>iBeacons 似乎广播了他们的 txPower 参数(报告 1 米距离处的 RSSI 功率),该参数用于计算 <code>beacon.accuracy</code> 和 <code>beacon.proximity</code> 属性(详情在 iBeacon广告包可以找到<a href="https://stackoverflow.com/questions/18906988/what-is-the-ibeacon-bluetooth-profile" rel="noreferrer noopener nofollow">here</a>)。 </p>

<p>但是,<code>CLBeacon</code> 类似乎没有 txPower 的属性。有没有办法可以使用 Core Location 框架获得 txPower,或者我需要进入 Core Bluetooth?我需要这个的原因是我想尝试自定义信标精度/接近度计算,以实现非常快速的信标即时范围发现。在这种情况下,从 <code>accuracy</code> 反向计算 txPower 是没有帮助的。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>很遗憾,您无法使用 <code>CoreLocation</code> 或 <code>CoreBluetooth</code> 以编程方式获取此值。 Apple 使用 <code>CoreBluetooth</code> 阻止对所有 iBeacon 数据的访问(参见我对此的分割 <a href="http://developer.radiusnetworks.com/2013/10/21/corebluetooth-doesnt-let-you-see-ibeacons.html" rel="noreferrer noopener nofollow">here</a> 。)与 <code>CoreLocation</code> 类似,它根本不会在 <code>CLBeacon</中公开code> 类,如你所见。</p>

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

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

<p>上面的选项 2 显然要求您为所有正在测试的 iBeacon 分配唯一标识符。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - iBeacon : how to get broadcasted beacon power (txPower),我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/24001702/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/24001702/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - iBeacon : how to get broadcasted beacon power (txPower)