I'm developing an app that pairs to a custom piece of hardware over BLE. Right now I'm working on a way to handle the case where the user mis-enters the PIN code. I see that didUpdateNotificationStateFor is passed an error message in this case saying "Encryption is insufficient.". But it seems like there has to be a better way to handle and react to that case.
Do I really need to rely on a string-compare against error message in order to determine when to display the instructions on how to reset everything and restart the pairing workflow? Is there something I'm missing in this documentation?
Post
Replies
Boosts
Views
Activity
I am developing an app that uses CoreBluetooth to communicate with a proprietary piece of hardware. I would like to be able to write tests for it, but there does not seem to be any way to mock or simulate the presence of, for example a CBPeripheral object.
This library (https://github.com/NordicSemiconductor/IOS-CoreBluetooth-Mock) almost does what I need, but it's not quite flexible enough. I think they have the right idea, but it doesn't seem to be actively maintained anymore.
This seems like a pretty big hole in the iOS SDK. Is there really not an officially supported way of testing BLE functionality?
I know this will sound like a weird use case, but it is potentially relevant to a product I am working on.
If I were to link two or more iPhones to the same iCloud account (I know this is uncommon and generally a bad idea, but it is possible so I have to consider it). Next I pair a BLE device to one of the phones using my app which has the background bluetooth permission with the app acting as the central so it can automatically restore a connection when the BLE device comes back into range.
I then install the same app on the other iPhone(s) linked to this account and separate them physically so they are out of BLE range of each other.
The BLE device is taken out of range of the first phone and into range of one of the others.
First question is will the BLE device automatically connect to the other iPhone?
If yes, will the app have any way of determining that it's running on a different iPhone with the same device connected?
If yes, can the app prevent connection to the other phones in some way?