Prevent connection of BLE device to GATT server
-
21-12-2019 - |
Question
Third party BLE device has attempt to connect to my GATT server, the result is that device become inaccessible for his native app. My wild guess is I should prevent connection of that device to my GATT server, but I don't know how to do that. Any suggestion? Thanx
Solution 2
The decision was not so trivial: it is necessary to clear any links to previously discovered (scanned) BLE devices by onLeScan
when app goes to background (onPause
received, but still not onDestroy
). If you still keeping these links, you'll unable to connect to those devices from other app.
OTHER TIPS
You could configure your GATT server with a White List of devices that you wish to accept connections from. That way it will not accept connections from any 3rd party devices.