mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-22 02:14:28 +10:00
Refactor repeater status screen and settings screen; add GPS toggle
- Updated _RepeaterStatusScreenState to load status after the first frame to avoid mid-build notifyListeners() calls. - Removed unused _statusRequestedAt variable and adjusted _clockText() to use repeaterClockAtLogin for time display. - Enhanced _SettingsScreenState with a GPS toggle switch that updates custom variables for GPS settings. - Cleaned up RepeaterCommandService by removing redundant pending command checks and adjusted command ID generation. - Removed jni plugin from generated_plugins.cmake for both Linux and Windows platforms.
This commit is contained in:
@@ -25,14 +25,6 @@ class RepeaterCommandService {
|
||||
Function(int)? onAttempt,
|
||||
int retries = maxRetries,
|
||||
}) async {
|
||||
final repeaterKey = repeater.publicKeyHex;
|
||||
final hasPending = _pendingCommands.keys.any(
|
||||
(id) => id.startsWith(repeaterKey),
|
||||
);
|
||||
if (hasPending) {
|
||||
throw Exception('Another command is still awaiting a response.');
|
||||
}
|
||||
|
||||
final attemptCount = retries < 1 ? 1 : retries;
|
||||
final selection = await _connector.preparePathForContactSend(repeater);
|
||||
|
||||
@@ -62,14 +54,14 @@ class RepeaterCommandService {
|
||||
int attempt,
|
||||
) async {
|
||||
final repeaterKey = repeater.publicKeyHex;
|
||||
final commandId = '${repeaterKey}_${DateTime.now().millisecondsSinceEpoch}';
|
||||
final prefix = _nextPrefixToken();
|
||||
final commandId = '${repeaterKey}_$prefix';
|
||||
final completer = Completer<String>();
|
||||
_pendingCommands[commandId] = completer;
|
||||
_commandPrefixes[commandId] = prefix;
|
||||
_pendingByPrefix[prefix] = commandId;
|
||||
|
||||
try {
|
||||
final prefix = _nextPrefixToken();
|
||||
_commandPrefixes[commandId] = prefix;
|
||||
_pendingByPrefix[prefix] = commandId;
|
||||
final framedCommand = '$prefix$command';
|
||||
final pathLengthValue = selection.useFlood ? -1 : selection.hopCount;
|
||||
final timestampSeconds = DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||
|
||||
Reference in New Issue
Block a user