Added error catching to requestBatteryStatus
to call _handleDisconnection when it fails update. Updated ScannerScreen to manage navigation state logic on connection.
This commit is contained in:
1 parent
8b0bdd9a46
commit
34a6b5d895
2 files changed
+34
-11
No files matched your search
@@ -959,7 +959,13 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
if (!isConnected) return;
|
||||
if (_batteryRequested && !force) return;
|
||||
_batteryRequested = true;
|
||||
await sendFrame(buildGetBattAndStorageFrame());
|
||||
try {
|
||||
await sendFrame(buildGetBattAndStorageFrame());
|
||||
} catch (e) {
|
||||
// Reset flag on error to allow retry
|
||||
_handleDisconnection();
|
||||
_batteryRequested = false;
|
||||
}
|
||||
}
|
||||
|
||||
void _startBatteryPolling() {
|
||||
|
||||
Reference in new issue
Block a user