From 6c4695ec9dd57b8527d230c745d8d90e18d47762 Mon Sep 17 00:00:00 2001 From: Drew Ballance Date: Tue, 13 Jun 2023 13:36:10 -0500 Subject: [PATCH] Revert "fix: remove restored state from dart" This reverts commit 74b59c22700916acbdbd02491504df8e39a639f1. --- .../ios/Classes/Plugin/PluginController.swift | 2 +- .../lib/src/model/connection_state_update.dart | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/reactive_ble_mobile/ios/Classes/Plugin/PluginController.swift b/packages/reactive_ble_mobile/ios/Classes/Plugin/PluginController.swift index ca8d2707..c5dbfecf 100644 --- a/packages/reactive_ble_mobile/ios/Classes/Plugin/PluginController.swift +++ b/packages/reactive_ble_mobile/ios/Classes/Plugin/PluginController.swift @@ -73,7 +73,7 @@ final class PluginController { message = DeviceInfo.with { $0.id = peripheral.identifier.uuidString // Restored device state is different from peripheral state from connection manager - $0.connectionState = encode(.connected) + $0.connectionState = 4 } case .failedToConnect(let underlyingError), .disconnected(let underlyingError): diff --git a/packages/reactive_ble_platform_interface/lib/src/model/connection_state_update.dart b/packages/reactive_ble_platform_interface/lib/src/model/connection_state_update.dart index 6ee0ca65..13bcf827 100644 --- a/packages/reactive_ble_platform_interface/lib/src/model/connection_state_update.dart +++ b/packages/reactive_ble_platform_interface/lib/src/model/connection_state_update.dart @@ -35,7 +35,10 @@ enum DeviceConnectionState { disconnecting, /// Device is disconnected. - disconnected + disconnected, + + /// Device is restored (iOS only - when using state restoration) + restored } /// Type of connection error.