feat: GPS module toggle in device settings

This commit is contained in:
Janez T
2026-03-17 09:30:13 +01:00
parent 464fc5e715
commit 59f6df4260
3 changed files with 85 additions and 1 deletions

View File

@@ -2202,6 +2202,30 @@ class ConnectionProvider with ChangeNotifier {
}
/// Request fresh device info (triggers SelfInfo response)
/// Read custom variables from device (GPS mode, sensor settings, etc.)
Future<Map<String, String>> getCustomVars() async {
if (!_activeService.isConnected) {
return {};
}
try {
return await _activeService.getCustomVars();
} catch (e) {
debugPrint('⚠️ [Provider] getCustomVars failed: $e');
return {};
}
}
/// Set a custom variable on the device
Future<void> setCustomVar(String key, String value) async {
if (!_activeService.isConnected) return;
try {
await _activeService.setCustomVar(key, value);
} catch (e) {
_error = 'Failed to set $key: $e';
notifyListeners();
}
}
Future<void> refreshDeviceInfo() async {
if (_isSpectrumScanActive) return;
if (!_activeService.isConnected) {