Improve disconnect api (#192)
* Improve disconnect api * Get disconnection event on Web from callback * Wait for disconnection result on calling disconnect * Improve linux disconnection * Update Changelog * Fix Ai comments
This commit is contained in:
@@ -260,8 +260,16 @@ class _PeripheralDetailPageState extends State<PeripheralDetailPage> {
|
||||
PlatformButton(
|
||||
text: 'Disconnect',
|
||||
enabled: isConnected,
|
||||
onPressed: () {
|
||||
bleDevice.disconnect();
|
||||
onPressed: () async {
|
||||
try {
|
||||
await bleDevice.disconnect();
|
||||
_addLog("DisconnectResult", true);
|
||||
} catch (e) {
|
||||
_addLog(
|
||||
'DisconnectError (${e.runtimeType})',
|
||||
e,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user