0

can we control pairing and unpairing to device in iOS code.my problem is that if BLE device connected to my app it is reading data properly and it is asking me every time for paring to BLE device as i click on pair it is not reading data from BLE device.and if unpair my ble device it is reading data.

  • This question appears to be off-topic because it is not about programming. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Apple Stack Exchange](http://apple.stackexchange.com/) would be a better place to ask. – jww Sep 29 '14 at 06:11

1 Answers1

1

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

Paulw11
  • 108,386
  • 14
  • 159
  • 186
  • This is correct, but how about unpairing? Is there a way to unpair from code, or from the BLE device persepective? – Can Nov 05 '15 at 20:03
  • You cannot unpaid a device programmatically from an iOS app. The peripheral device may expose some method of deleting the bonding information but this would be device/chipset specific. – Paulw11 Nov 05 '15 at 20:19