Bluetooth
Bluetooth pairing?
Hi
I'm still learning so please give it to me in plain English.
It took me a while to figure out that pairing and bonding were two separate things and how it all worked.
My question is, how can I stop another phone to be able to pair to my ble peripheral. It doesn't really matter what ble module I use here or what app. It's to do with pairing and not bonding.
Senario using 2 Android phones: phone A and phone B.
1. I turn ble Bluetooth module on.
2. I use phone A and search for device in Bluetooth settings
3. I connect (pair) to Bluetooth device.
4. I now move phone A far away out of Bluetooth range or turn of phone Bluetooth off.
5. I now use phone B and search for Bluetooth device in settings
6. I connect (pair) to Bluetooth device.
7. I now basically have two phones that have the same Bluetooth module added as a paired device.
My problem is I don't want a second phone to be able to pair to the Bluetooth device.I somehow want the Bluetooth module to remember the phone it paired to(not bonded) and only allow that phone.
I am well aware that if phone A pairs and it stays in Bluetooth range of Bluetooth module then phone B will not be able to pair to the module. It will find it when doing a scan but it will not be able to pair with it, but if I turn phone A Bluetooth settings off or move phone A out of range the phone B will be able to pair with it. I am aware that pairing and bonding are two different things and so I'm not asking about bonding or the function of the App used when bonding occurs.
I am aware the pairing via passkey (authentication protocol) if enabled) will stop any stranger from trying to pair but lets just say it's two people living in same house and both know the passkey. It doesn't really matter whether is uses a passkey or not, it still has same issue.
Why I'm asking this is, if someone pairs to my device on purpose or by accident I'll not be able to pair to my own device whilst they are paired and in range. If they paired and then move out of range then only I'll be able to pair and the bonding will occur via my app.
Is there anything I can do about this.
Please excuse me if it's a silly question but I tried finding the answer on the Internet and I couldn't and it seems not many people have this issue to begin with.
I think it might also be that many Bluetooth devices have a very short range and so when you do a Bluetooth search on a phone you only pick up a few Bluetooth devices and not thousands. My Bluetooth device is a class 1 2MPY with a external antenna and has a very big range so it will appear on many users phones. I want to prevent someone from pairing to my device after I have paired already but I'm not in range anymore or have turned off my Bluetooth settings in my phone.
I hope my explanation is good enough.
Thanks