删除核心蓝牙连接中的PIN [英] Removing PIN in Core Bluetooth Connection

查看:166
本文介绍了删除核心蓝牙连接中的PIN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款通过核心蓝牙(BLE)连接手机的应用程序。连接和数据传输工作精美,但有一个小缺陷。连接新设备时,必须在其中一个设备上输入引脚。应用程序应该是非常瞬时的,并且引脚输入会极大地中断此过程。我并不担心安全问题,而且我个人将手机连接到许多蓝牙设备而没有输入引脚,所以我只是想知道如何通过iOS api完成这项工作。

I'm working on an application that connects phones via core bluetooth (BLE). The connection and data transmission work beautifully, but there is one small imperfection. When connecting to a new device, a pin must be entered on one of the devices. The application is supposed to be very instantaneous, and the pin-input greatly interrupts this process. I'm not worried about security, and I've personally connected my phone to many bluetooth devices without entering pins, so I was just wondering how this could be done with the iOS api.

谢谢!

推荐答案

如果使用'encryptionRequired'属性指定任何外围设备的特征( CBCharacteristicPropertyNotifyEncryptionRequired CBCharacteristicPropertyIndi​​cateEncryptionRequired )或权限( CBAttributePermissionsReadEncryptionRequired CBAttributePermissionsWriteEncryptionRequired )然后在设备之间需要绑定。

If you specify any of your peripheral's characteristics with an 'encryptionRequired' property (CBCharacteristicPropertyNotifyEncryptionRequired or CBCharacteristicPropertyIndicateEncryptionRequired) or permissions (CBAttributePermissionsReadEncryptionRequired or CBAttributePermissionsWriteEncryptionRequired) then bonding is required between the devices.

如果设备尚未绑定,则会触发配对对话框并要求输入引脚。如果您未指定外围设备特性的任何加密属性或权限,则不会提示您配对。

If the devices aren't already bonded then this will trigger the pairing dialog and require a pin to be entered. If you don't specify any of the encryption properties or permissions on your peripheral's characteristics then you won't be prompted to pair.

这篇关于删除核心蓝牙连接中的PIN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆