Hi,
I have used several Bluetooth Low Energy solutions and I looked into several examples and something is missing. What I miss is to prevent pairing. It is something quite obvious. At least from my point of view. You don't want you neighbor to be able to pair with your device.
Most examples I see is that you activate (turn on) the device and you can pair with your phone. Some devices are limited to pair only with one device so you have your security settled now. But what if it can pair with more than one device? When it is turned on other people can pair as long as it is not connected.
What I want is to confirm the pairing or to initiate the pairing from my device. My device only has one button. I have looked into static pin pairing but as the iPhone has a display it will pop-up with a random pin code which I can't type because I have only one button. As far as I know it is not possible in iOS the say that it has only keyboard capabilities. So I end up with a device having no capabilities and therefore only supports it "just works". But this is a security issue in my opinion. I want to be in control to who or what my devices pairs to.
The nicest solution would be to initiate the pairing and than confirm it on my device with the button. This is however, a scenario they did not thought of when writing the Bluetooth Low Energy specification. There is no defined (or unlimited) timeout between initiate pairing and confirming. So between SMP Pairing Request and SMP Pairing Response. Because of the user interaction the timeout here should be quite large.
The other scenario (and I have used this one on anther device) is to press the button so it can be paired for e.g. 30 seconds. If the button is not pressed only devices which have bond information are allowed to connect. All other devices are disconnected immediately. The drawback here is that if you have multiple devices it is hard to choose the correct device on your smart phone.
Anyway, the device manager has no hooks or events I can use to prevent the device manager from pairing and directly disconnect when not in pairing mode and no bonding information is found.
Now finally my question. Does somebody else thought about this or am I the only one. Are there other possibilities I overlooked? Please let me know.
Best Regards, Marcel