This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pairing with iOS

Hi,

I am having a BLE peripheral on NRF51822 chip. I have set to MITM to 0. I want to communicate with an iOS app which will act as central device. When i first connect with the iOS app it asks "Whether you want to pair or not". I then click on pair and the devices get paired. After that i disconnect the BLE connection. Now when i again try to connect it doesnt ask for pairing. I want to ask for pairing everytime i connect and disconnect. How can i do this? Do i need to make changes on the peripheral side or Central side? And also if you can please help us with the changes that need to be made.

Thanks

  • Why do you want to do this? Unfortunately, from iOS9.x you have to bond with iOS. For some reason they decided not to support pairing anymore (at least not with iOS9.1). Unfortunately this means you have to manually delete the bond data on both your peripheral and central if you want to create a new bond.

  • Is there anyway programmatically we can delete the bond information when the device loses connection in iOS and peripheral.

  • This is not possible on iOS, and has to be done manually by the end user. On the nRF51; sure, but why do you want to do this?

  • Paring with iOS is notoriously difficult to get right and it is very annoying for the user experience depending on the application.

    I agree with run_ar in asking why you want to do this.

    However, I'll also add that if you are using pairing/bonding for security, then in this situation, you might want to implement your own device and app side security mechanism. This requires incorporating your own encryption engine on the device side (such as AES-128). You will likely want to choose something that is available on iOS (and probably Android also). So, if data privacy is your goal, then you can forego built-in BLE encryption (it's really easy to break anyway) and build in your own encryption scheme. You may also want to consider some form of authentication to make sure only your app can talk to your device.

  • Sumit,

    I will echo the questions here to ask why would you want to constantly pair? The disadvantages of pairing again are:

    1. Both devices expend energy and take time to generate keys and exchange them again. This causes a delay before your app can actually connect to the device.

    2. Since they keys are constantly being exchanged, you're actually weakening the security because it's easier to sniff the initial transactions which are the "weak" link. Reducing the number of pairings means less chances for this to happen

    My suggestion is to do this on the app side. Ask the user yourself whether they want to connect. Note that connection and pairing are different concepts. Pairing means that the encryption and other keys have been exchanged between the devices, while connection can be done with or without pairing. You don't have to be paired to be connected, and you do have to be connected if you're paired.

    There are a few cases where you do want to pair, but it depends on your product.

Related