Closed LucasLeung1024 closed 2 years ago
In your class which extends BleManager you can call
disconnect().enqueue();
which triggers an async disconnect. you can add callbacks when disconnect succeeds or fails by calling
disconnect()
.done(this::onDisconnected)
.fail(this::onConnectionOperationFailed)
.enqueue();
where onDisconnected and onConnectionOperationFailed are functions in your class which have a signature like
protected void onDisconnected(BluetoothDevice device){
// your callback code
}
Thank you @niklasdahlheimer for excellent answer!
hi, can u explain to disconnect a connected device, I'm trying to use disconnect() in
but nothing happend,