Android-BLE-Library icon indicating copy to clipboard operation
Android-BLE-Library copied to clipboard

Companion Device Manager strategy for non bonded device

Open jonschmidt opened this issue 3 years ago • 2 comments

Our app needs to connect with a single bluetooth peripheral with the following characteristics:

  • we do not use bonding or pairing (we have our own encryption scheme to secure them)
  • each app will only connect to a single device at a time, and we know the advertising name + mac address ahead of time
  • the mac addresses are not considered public mac addresses
  • the app should connect whenever the bluetooth device comes available

We want to use the companion device manager, as in tests it seems very reliable with waking up the application when the device is turned on on later SDKs. This means that we do not have to scan for the device, as we have used the CDM to pair.

We try to connect to the device using autoconnect = true, however it still times out until we connect the first time (by design I have read).

How should we connect when we use Companion Device Pairing and already have the mac address successfully stored? If we are supposed to just keep timing out and retrying, should we retry with the same instance of the ble manager each time?

jonschmidt avatar Jun 16 '22 19:06 jonschmidt

Hello,

The Companion Device Manager displays a native UI and scans for the device until it's selected or cancelled, as far as I know. After selecting it, you should get a callback and the device should be in range, so connection should happen immediately. I guess there's something I don't fully understand in your case, could you elaborate?

I'm sorry for the very late response.If you've managed to solve your issue, please close the issue.

philips77 avatar Sep 20 '22 20:09 philips77

I am also interested in this question, any progress?

lgnativs avatar Feb 24 '23 03:02 lgnativs