-
Notifications
You must be signed in to change notification settings - Fork 129
Disconnect devices button doesn't disconnect #58
Comments
Do you have some reproduction steps? What device did you connect with? |
I'll be more detailed tomorrow. |
|
I'm still able to reproduce this sadly and I wish https://googlechrome.github.io/samples/web-bluetooth/device-disconnect.html would work with this app. Code below isn't actually working as private void disconnectFromDevices() {
Log.d(TAG, "Disconnecting devices...");
for (BluetoothDevice device : mBluetoothManager.getConnectedDevices(
BluetoothGattServer.GATT)) {
Log.d(TAG, "Devices: " + device.getAddress() + " " + device.getName());
mGattServer.cancelConnection(device);
}
}
WDYT @g-ortuno? |
That's what we use to do but getConnectedDevices seemed like a better approach. We could work around the android bug but we should also report it. |
It looks like |
Looking at it more closely, I think that |
cancelConnection doesn't really disconnect the device and it saved the connection state if we again go for ble connection. No Callback is received to central on calling above method. |
I faced with the same problem, cancelConnection() doesn't work. I have the issue when I want to connect with only one Central device, but if there are more devices ready to connect, Android generates few "onConnectionStateChanged" events before Advertising is really stopped. After that it's impossible to disconnect unwanted devices using cancelConnection() |
Calling
mGattServer.cancelConnection(device);
doesn't disconnect device as I've observed in btmon and adb logs when tapping "Disconnect devices" button.Moreover,
onConnectionStateChange
is not called which means "Devices connected" text is not updated.@g-ortuno
The text was updated successfully, but these errors were encountered: