File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/flutter_reactive_ble/lib/src Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,12 @@ class FlutterReactiveBle {
300300 ),
301301 );
302302
303+ /// Disconnects a device with the provided id.
304+ ///
305+ /// Useful for restored devices where a connection subscription is not obtained.
306+ Future <void > disconnect ({required String id}) =>
307+ _blePlatform.disconnectDevice (id);
308+
303309 /// Performs service discovery on the peripheral and returns the discovered services.
304310 ///
305311 /// When discovery fails this method throws an [Exception] .
@@ -337,6 +343,16 @@ class FlutterReactiveBle {
337343 );
338344 }
339345
346+ /// Unsubscribes to updates from the characteristic specified.
347+ ///
348+ /// Useful for restored devices that do not read as "connected"
349+ Future <void > unsubscribeToCharacteristic (
350+ QualifiedCharacteristic characteristic,
351+ ) async {
352+ await initialize ();
353+ return _blePlatform.stopSubscribingToNotifications (characteristic);
354+ }
355+
340356 /// Sets the verbosity of debug output.
341357 ///
342358 /// Use [LogLevel.verbose] for full debug output. Make sure to run this only for debugging purposes.
You can’t perform that action at this time.
0 commit comments