react-native-ble-manager icon indicating copy to clipboard operation
react-native-ble-manager copied to clipboard

isPeripheralConnected returns false while I'm connected.

Open edwardkes opened this issue 3 years ago • 2 comments

I have a question about the way isPeripheralConnected works. To check if I'm connected to the device, do I have to be connected to it at the App level or at the device level? I did a test, where I was only connected at the device level to my BT headset and the method returned false for the UUID I used. However, once I also connected to the headset at the App level, I got true for the connection for the same UUID. Is my assumption correct that I need to be connected to the device with the app to see the connection as true?

edwardkes avatar Dec 20 '21 11:12 edwardkes

Do only I not understand the question?

Silvesterrr avatar Feb 10 '22 23:02 Silvesterrr

Do only I not understand the question?

He basically connected to his headphones through his phone's bluetooth settings, then tried to check from his application (using ble-manager lib) if his headphones were reported as connected (trough isPeripheralConnected method, passing the UUID of his headphones). Method returned false. Then he tried to call the connect method of the library against his headphones and tried to check again the connection status, and this time the method isPeripheralConnected returned true.

So the question is: is connection state returned from isPeripheralConnected method handled at OS level or at application level? And for what I've seen (and what you' ve tried) everything about this method (isPeripheralConnected) is handled at application level from the library (but I haven't seen internal code to be honest)

coletz avatar Jun 27 '22 17:06 coletz

Thanks coletz. Is there any way to discover OS level?

samknp avatar Jan 25 '23 12:01 samknp

same issue even though i already connect to device it is giving false

sfsnaruto avatar May 28 '23 08:05 sfsnaruto

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

marcosinigaglia avatar Dec 10 '23 02:12 marcosinigaglia