Hi,

while reading Android documentation I come to this recommendation:

"Note: You should always call cancelDiscovery() to ensure that the device isn't performing device discovery before you call connect(). If discovery is in progress, then the connection attempt is significantly slowed, and it's more likely to fail." (https://developer.android.com/guide/topics/connectivity/bluetooth.html)

I don't see any call to BluetoothAdapter.cancelDiscovery() so it might be good idea to add it? On the other hand, since you are calling the connect() method repeatedly every few seconds, it would mean that bluetooth discovery will never have a chance to finish (as cancelling it has global effect for whole system). So unless this automatic repeated connection will be rewritten somehow, current way without cancelDiscovery() is perhaps okay?

Btw what about power consumption and battery life regarding these repeated connection attempts? Do you know if it has any impact or is it "safe" to use this way?

Thanks,
Robert
_______________________________________________
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.com
For general information, go to: http://brltty.com/mailman/listinfo/brltty

Reply via email to