mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-02 15:10:36 +10:00
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:
@@ -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