菜鸟教程小白 发表于 2022-12-13 10:16:07

ios - 蓝牙 4.0 低功耗和 iOS : How do I detect if device is bondable or not?


                                            <p><p>是否可以使用 corebluetooth 框架来检测外围设备是否可绑定(bind)? </p>

<p>我应该实现连接失败的委托(delegate)吗?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>此时什么都没有。对于更高版本的 BLE,绑定(bind)信息(GAP 模式)位于 GAP 配置文件中,但您无法通过 CoreBluetooth 获得任何信息。除部分广告数据和有限的扫描响应数据外,仅提供GATT及以下信息。</p>

<p>您可以读取任何所需的特征属性以查看它是否需要加密 (<code>CBCharacteristicPropertyNotifyEncryptionRequired</code>),这意味着您需要有一个受信任的连接(配对)才能访问它。这与您现在将要获得的一样接近。</p>

<p>首次连接时不应提示您配对,因此 <code>didFailToConnectPeripheral</code> 在这里没有帮助。只有在您尝试读取其中一个加密特征后,才会提示您配对。所以,如果你先检查特征的属性,你应该在提示用户之前知道。</p>

<p>来自 Apple 的 <a href="https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf" rel="noreferrer noopener nofollow">Bluetooth Accessory Design Guidelines</a> :</p>

<blockquote>
<p>The accessory should not request pairing until an ATT request is
rejected using the Insufficient Authentication error code. See the
Bluetooth 4.0 specification, Volume 3, Part F, Section 4 for details.</p>

<p>If, for security reasons,the accessory requires a bonded relationship
with the Central,the Peripheral should reject the ATT request using
the Insufficient Authentication error code, as appropriate. As a
result, the Apple product may proceed with the necessary security
procedures.</p>
</blockquote></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 蓝牙 4.0 低功耗和 iOS : How do I detect if device is bondable or not?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/28351579/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/28351579/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 蓝牙 4.0 低功耗和 iOS : How do I detect if device is bondable or not?