• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

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

[复制链接]
菜鸟教程小白 发表于 2022-12-13 10:16:07 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

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

我应该实现连接失败的委托(delegate)吗?



Best Answer-推荐答案


此时什么都没有。对于更高版本的 BLE,绑定(bind)信息(GAP 模式)位于 GAP 配置文件中,但您无法通过 CoreBluetooth 获得任何信息。除部分广告数据和有限的扫描响应数据外,仅提供GATT及以下信息。

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

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

来自 Apple 的 Bluetooth Accessory Design Guidelines :

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.

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.

关于ios - 蓝牙 4.0 低功耗和 iOS : How do I detect if device is bondable or not?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28351579/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap