简体   繁体   中英

iOS bluetooth paring to device and unparing

我们可以控制iOS代码中与设备的配对和取消配对吗?我的问题是,如果BLE设备连接到我的应用程序,它将正确读取数据,并且每次我都要求我将其配对到BLE设备,因为我单击配对时就无法读取数据从BLE设备。如果取消配对我的ble设备,它正在读取数据。

BLE devices do not require pairing with iOS unless you attempt to read or write an attribute where encryption is required - if so then iOS will automatically initiate pairing by presenting a dialog to the user. The pairing operation should be transparent to your application.

Once the user has completed the pairing process then iOS will store the appropriate keys and pair with the device automatically on subsequent connections.

When working with a BLE device you should not manually initiate a pairing operation through settings - if you do so then you risk putting a dual-mode peripheral into Bluetooth 2.1 mode and you will be unable to interact with it using BLE/Core Bluetooth

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM