btleplug
btleplug copied to clipboard
iOS cannot disconnect the Bluetooth connection
Describe the bug
I‘m from flutter_btleplug. After scanning, I add two buttons on scanned items, connect and disconnect. The connection works, but the disconnected connection does not work.
BUT, code in examples works. https://github.com/deviceplug/btleplug/blob/master/examples/subscribe_notify_characteristic.rs
Why?
Expected behavior
disconnect works
Actual behavior
disconnect doesn't work
Additional context
child: Column(
children: [
Text(s.name),
Text(s.id),
ElevatedButton(
onPressed: () {
connect(id: s.id);
},
child: Text("connect")),
ElevatedButton(
onPressed: () {
disconnect(id: s.id);
},
child: Text("disconnect")),
],
https://github.com/trobanga/flutter_btleplug/blob/7600adaf5304ff2d1d37f35ae739bc5248761c71/lib/main.dart#L56
https://github.com/trobanga/flutter_btleplug/issues/48
Here is a log of the disconnection process
flutter: disconnect to 15085272-df52-0046-b23d-18fea9a7fc63
Adapter message!
Trying to disconnect peripheral!
Disconnecting peripheral!
delegate_centralmanager_diddisconnectperipheral_error CBPeripheral(..., ...)
Got disconnect event!
ZDIS 3 CoreBluetoothReply::Ok
ZDIS 1 adapter_manager.emit
It depends. Some LE device works, some doesn't work
callinng unsubscibe before disconnect