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:
Winston Lowe
2026-01-28 19:55:08 -08:00
parent 8b0bdd9a46
commit 34a6b5d895
2 changed files with 34 additions and 11 deletions
+7 -1
View File
@@ -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() {