From 16165b5ddcd52617b7958ce846bd1b8e52d981ea Mon Sep 17 00:00:00 2001 From: diffwireauto <330573775+diffwireauto@users.noreply.github.com> Date: Thu, 19 Nov 2026 03:06:30 -0500 Subject: [PATCH] feat(#1158): refuse a local CLI send the radio can't run, and say why Epic #1155, owner decision 2 (2026-11-19): block the write, not only the button. LocalCliService.run refuses before building frame 66 when supportsLocalCli is false: nothing is sent, a warning is logged (without the command text, which may hold a secret), and LocalCliUnsupported is thrown. LocalCliTransport maps it to CliConsoleUnsupported, and the console adds a row that stays in the transcript: ": not sent. Your radio's firmware doesn't support the device CLI." English key only; untranslated.json regenerated (17 locales fall back to English). The existing local CLI suites now connect a stock 1.18 radio first, since an unclassified connector no longer sends frame 66. Tests: 40 pass across the service, console and transport suites. With the refusal check removed, the 2 refusal tests fail. Agent: BrightForge (session 440fbe94) Co-Authored-By: Claude Opus 5.5 --- lib/l10n/app_en.arb | 9 ++++ lib/l10n/app_localizations.dart | 6 +++ lib/l10n/app_localizations_bg.dart | 5 ++ lib/l10n/app_localizations_de.dart | 5 ++ lib/l10n/app_localizations_en.dart | 5 ++ lib/l10n/app_localizations_es.dart | 5 ++ lib/l10n/app_localizations_fr.dart | 5 ++ lib/l10n/app_localizations_hu.dart | 5 ++ lib/l10n/app_localizations_it.dart | 5 ++ lib/l10n/app_localizations_ja.dart | 5 ++ lib/l10n/app_localizations_ko.dart | 5 ++ lib/l10n/app_localizations_nl.dart | 5 ++ lib/l10n/app_localizations_pl.dart | 5 ++ lib/l10n/app_localizations_pt.dart | 5 ++ lib/l10n/app_localizations_ru.dart | 5 ++ lib/l10n/app_localizations_sk.dart | 5 ++ lib/l10n/app_localizations_sl.dart | 5 ++ lib/l10n/app_localizations_sv.dart | 5 ++ lib/l10n/app_localizations_uk.dart | 5 ++ lib/l10n/app_localizations_zh.dart | 5 ++ lib/screens/device_cli_screen.dart | 11 +++-- lib/services/cli_console_transport.dart | 11 +++-- lib/services/local_cli_service.dart | 29 ++++++++++-- test/screens/device_cli_screen_test.dart | 39 ++++++++++++++++ test/services/local_cli_service_test.dart | 56 +++++++++++++++++++++++ untranslated.json | 17 +++++++ 26 files changed, 257 insertions(+), 11 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index b2f3fda3..aafc1f18 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -240,6 +240,15 @@ } } }, + "deviceCli_localUnsupported": "{command}: not sent. Your radio's firmware doesn't support the device CLI.", + "@deviceCli_localUnsupported": { + "description": "Console row when the client refuses to send a local CLI command because the connected radio does not support the device CLI (#1158). Nothing was transmitted.", + "placeholders": { + "command": { + "type": "String" + } + } + }, "deviceCli_sendFailed": "Send failed: {error}", "@deviceCli_sendFailed": { "placeholders": { diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index cd0b9837..156e4d4f 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -790,6 +790,12 @@ abstract class AppLocalizations { /// **'{command}: not sent. Your radio\'s firmware doesn\'t support remote CLI.'** String deviceCli_remoteUnsupported(String command); + /// Console row when the client refuses to send a local CLI command because the connected radio does not support the device CLI (#1158). Nothing was transmitted. + /// + /// In en, this message translates to: + /// **'{command}: not sent. Your radio\'s firmware doesn\'t support the device CLI.'** + String deviceCli_localUnsupported(String command); + /// No description provided for @deviceCli_sendFailed. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_bg.dart b/lib/l10n/app_localizations_bg.dart index 16074096..3f447327 100644 --- a/lib/l10n/app_localizations_bg.dart +++ b/lib/l10n/app_localizations_bg.dart @@ -386,6 +386,11 @@ class AppLocalizationsBg extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 86d2d4ac..f0340538 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -389,6 +389,11 @@ class AppLocalizationsDe extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index c31afc87..6440d297 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -383,6 +383,11 @@ class AppLocalizationsEn extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index 4a731d04..378b8797 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -387,6 +387,11 @@ class AppLocalizationsEs extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index ca1692eb..3c3828c8 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -389,6 +389,11 @@ class AppLocalizationsFr extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_hu.dart b/lib/l10n/app_localizations_hu.dart index f8276eeb..ed509a59 100644 --- a/lib/l10n/app_localizations_hu.dart +++ b/lib/l10n/app_localizations_hu.dart @@ -386,6 +386,11 @@ class AppLocalizationsHu extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart index aa91e014..667169c8 100644 --- a/lib/l10n/app_localizations_it.dart +++ b/lib/l10n/app_localizations_it.dart @@ -389,6 +389,11 @@ class AppLocalizationsIt extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart index e7acd1d5..4bb768fe 100644 --- a/lib/l10n/app_localizations_ja.dart +++ b/lib/l10n/app_localizations_ja.dart @@ -376,6 +376,11 @@ class AppLocalizationsJa extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_ko.dart b/lib/l10n/app_localizations_ko.dart index 0739a01d..cb386181 100644 --- a/lib/l10n/app_localizations_ko.dart +++ b/lib/l10n/app_localizations_ko.dart @@ -375,6 +375,11 @@ class AppLocalizationsKo extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_nl.dart b/lib/l10n/app_localizations_nl.dart index f54677a7..d97138d5 100644 --- a/lib/l10n/app_localizations_nl.dart +++ b/lib/l10n/app_localizations_nl.dart @@ -385,6 +385,11 @@ class AppLocalizationsNl extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_pl.dart b/lib/l10n/app_localizations_pl.dart index 455aa673..31e80a5f 100644 --- a/lib/l10n/app_localizations_pl.dart +++ b/lib/l10n/app_localizations_pl.dart @@ -390,6 +390,11 @@ class AppLocalizationsPl extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart index c46b31ee..b2d8204c 100644 --- a/lib/l10n/app_localizations_pt.dart +++ b/lib/l10n/app_localizations_pt.dart @@ -388,6 +388,11 @@ class AppLocalizationsPt extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index a9332831..96326857 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -388,6 +388,11 @@ class AppLocalizationsRu extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_sk.dart b/lib/l10n/app_localizations_sk.dart index 18142185..88b7a9f6 100644 --- a/lib/l10n/app_localizations_sk.dart +++ b/lib/l10n/app_localizations_sk.dart @@ -387,6 +387,11 @@ class AppLocalizationsSk extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_sl.dart b/lib/l10n/app_localizations_sl.dart index f2ea851f..1414ecd9 100644 --- a/lib/l10n/app_localizations_sl.dart +++ b/lib/l10n/app_localizations_sl.dart @@ -385,6 +385,11 @@ class AppLocalizationsSl extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_sv.dart b/lib/l10n/app_localizations_sv.dart index 84f5f16a..c28758c1 100644 --- a/lib/l10n/app_localizations_sv.dart +++ b/lib/l10n/app_localizations_sv.dart @@ -384,6 +384,11 @@ class AppLocalizationsSv extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_uk.dart b/lib/l10n/app_localizations_uk.dart index 2877c165..b4493242 100644 --- a/lib/l10n/app_localizations_uk.dart +++ b/lib/l10n/app_localizations_uk.dart @@ -387,6 +387,11 @@ class AppLocalizationsUk extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart index d23c2d3d..413aabb3 100644 --- a/lib/l10n/app_localizations_zh.dart +++ b/lib/l10n/app_localizations_zh.dart @@ -373,6 +373,11 @@ class AppLocalizationsZh extends AppLocalizations { return '$command: not sent. Your radio\'s firmware doesn\'t support remote CLI.'; } + @override + String deviceCli_localUnsupported(String command) { + return '$command: not sent. Your radio\'s firmware doesn\'t support the device CLI.'; + } + @override String deviceCli_sendFailed(String error) { return 'Send failed: $error'; diff --git a/lib/screens/device_cli_screen.dart b/lib/screens/device_cli_screen.dart index b2c7ddb8..fe3bc6f6 100644 --- a/lib/screens/device_cli_screen.dart +++ b/lib/screens/device_cli_screen.dart @@ -233,11 +233,14 @@ class _DeviceCliScreenState extends State { ); } on CliConsoleUnsupported { if (!mounted) return; - // The connected radio refused the send itself (pre-1.18 firmware), so - // nothing went out: say so now instead of waiting out a timeout that - // would blame the target. + // Nothing went out: the radio refused a remote send (pre-1.18 firmware), + // or the client refused a local one (#1158). Say so now instead of + // waiting out a timeout that would blame the target. The row stays in + // the transcript, so the error persists until the console is closed. entry = _ConsoleEntry.sendFailed( - context.l10n.deviceCli_remoteUnsupported(command), + _isRemote + ? context.l10n.deviceCli_remoteUnsupported(command) + : context.l10n.deviceCli_localUnsupported(command), ); } catch (e) { if (!mounted) return; diff --git a/lib/services/cli_console_transport.dart b/lib/services/cli_console_transport.dart index 0580f2b6..3caebcd2 100644 --- a/lib/services/cli_console_transport.dart +++ b/lib/services/cli_console_transport.dart @@ -37,10 +37,11 @@ class CliConsoleTimeout implements Exception { String toString() => 'CLI command timed out after $secondsText s'; } -/// The connected radio refused to send a remote CLI command at all: its -/// firmware does not accept TXT_TYPE_CLI_COMMAND (pre-1.18 answers -/// ERR_CODE_UNSUPPORTED_CMD). Distinct from [CliConsoleTimeout], which means -/// the command went out and the target never answered. +/// The command was not run because the connected radio cannot run it. Remote: +/// its firmware refused TXT_TYPE_CLI_COMMAND (pre-1.18 answers +/// ERR_CODE_UNSUPPORTED_CMD). Local: the client refused before sending, as the +/// radio does not support the device CLI (#1158). Distinct from +/// [CliConsoleTimeout], which means the command went out and nothing answered. class CliConsoleUnsupported implements Exception { const CliConsoleUnsupported({required this.command}); @@ -73,6 +74,8 @@ class LocalCliTransport implements CliConsoleTransport { return await _service.run(command, timeout: timeout); } on LocalCliTimeout catch (e) { throw CliConsoleTimeout(command: command, secondsText: e.secondsText); + } on LocalCliUnsupported { + throw CliConsoleUnsupported(command: command); } } diff --git a/lib/services/local_cli_service.dart b/lib/services/local_cli_service.dart index 7e79e843..6d62e096 100644 --- a/lib/services/local_cli_service.dart +++ b/lib/services/local_cli_service.dart @@ -3,8 +3,10 @@ // correlated RESP_CODE_CLI_REPLY. No mesh legs, so no retries: the transport // is the connected link, and a lost frame surfaces as a timeout. // -// Population gating is NOT here: callers (the console entry point, #884) -// must only construct/offer this where the classifier allows frame 66. +// Callers (the console entry point, #884) only offer this where the radio +// supports frame 66. This also refuses the WRITE when it does not (#1158), so a +// caller that slips past the entry gate gets a loud, explained refusal rather +// than a frame the radio cannot run. import 'dart:async'; @@ -28,6 +30,17 @@ class LocalCliTimeout implements Exception { String toString() => 'CLI command timed out after $secondsText s'; } +/// Thrown, before anything is sent, when the connected radio does not run the +/// local CLI ([MeshCoreConnector.supportsLocalCli] is false) (#1158). +class LocalCliUnsupported implements Exception { + const LocalCliUnsupported({required this.command}); + + final String command; + + @override + String toString() => 'The connected radio does not support the device CLI'; +} + class LocalCliService { LocalCliService(this._connector) { _detach = _connector.addCliReplyListenerForLocalCli(_handleReply); @@ -46,8 +59,18 @@ class LocalCliService { static const Duration defaultTimeout = Duration(seconds: 10); /// Sends [command] to the connected device; completes with the correlated - /// reply or throws [LocalCliTimeout] / [ArgumentError] (codec rejections). + /// reply or throws [LocalCliTimeout] / [ArgumentError] (codec rejections) / + /// [LocalCliUnsupported] (nothing sent). Future run(String command, {Duration? timeout}) async { + if (!_connector.supportsLocalCli) { + // The command text is not logged: it may carry a secret (set wifi.pwd). + appLogger.warn( + 'CLI command refused, not sent: the connected radio does not ' + 'support the device CLI', + tag: 'LocalCli', + ); + throw LocalCliUnsupported(command: command); + } final window = timeout ?? defaultTimeout; final prefix = _prefixes.next(_pending.keys.toSet()); final frame = buildRunCliCommandFrame(command, prefix: prefix); diff --git a/test/screens/device_cli_screen_test.dart b/test/screens/device_cli_screen_test.dart index a138c9b8..2390c6fc 100644 --- a/test/screens/device_cli_screen_test.dart +++ b/test/screens/device_cli_screen_test.dart @@ -64,6 +64,14 @@ void main() { sent = []; connector.sendFrameOverrideForTest = sent.add; connector.setConnectedForTest(); + // A stock 1.18 radio, so the console may send frame 66 (#1158). + final v = ascii.encode('v1.18.0'); + final info = Uint8List(82) + ..[0] = 13 + ..[1] = 14 + ..setRange(60, 60 + v.length, v); + connector.handleFrameForTest(info); + sent.clear(); }); tearDown(() async { @@ -398,4 +406,35 @@ void main() { expect(find.textContaining('may not allow remote CLI'), findsNothing); }); }); + + // #1158: a local command on a radio without the device CLI is refused before + // anything is sent, and the console row says why and stays. + testWidgets('local: a radio without the device CLI refuses, nothing sent', ( + tester, + ) async { + final v = ascii.encode('1.4.0-1.17.0'); + final offband = Uint8List(87) + ..[0] = 13 + ..[1] = 22 + ..setRange(60, 60 + v.length, v); + connector.handleFrameForTest(offband); + sent.clear(); + await pumpScreen(tester); + + await send(tester, 'get radio'); + await tester.pumpAndSettle(); + + expect( + find.text( + "get radio: not sent. Your radio's firmware doesn't support the " + 'device CLI.', + ), + findsOneWidget, + ); + expect( + sent.where((f) => f.isNotEmpty && f[0] == cmdRunCliCommand), + isEmpty, + ); + expect(find.textContaining('no reply'), findsNothing); + }); } diff --git a/test/services/local_cli_service_test.dart b/test/services/local_cli_service_test.dart index ecaa85e7..ff067595 100644 --- a/test/services/local_cli_service_test.dart +++ b/test/services/local_cli_service_test.dart @@ -5,6 +5,8 @@ import 'package:drift/native.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:meshcore_open/connector/cli_command_codec.dart'; import 'package:meshcore_open/connector/meshcore_connector.dart'; +import 'package:meshcore_open/connector/offband_capability_advert.dart'; +import 'package:meshcore_open/connector/offband_device_ui.dart'; import 'package:meshcore_open/services/app_debug_log_service.dart'; import 'package:meshcore_open/services/command_correlation.dart'; import 'package:meshcore_open/services/local_cli_service.dart'; @@ -14,6 +16,24 @@ import 'package:meshcore_open/storage/drift/offband_database.dart'; import 'package:meshcore_open/storage/prefs_manager.dart'; import 'package:shared_preferences/shared_preferences.dart'; +Uint8List _deviceInfo(int length, int verCode, String version) { + final v = ascii.encode(version); + final f = Uint8List(length); + f[0] = 13; + f[1] = verCode; + f.setRange(60, 60 + v.length, v); + return f; +} + +Uint8List stock118DeviceInfo() => _deviceInfo(82, 14, 'v1.18.0'); +Uint8List offbandDeviceInfo() => _deviceInfo(87, 22, '1.8.0-1.18.0'); + +Uint8List advert(List tags) => Uint8List.fromList([ + cmdOffbandDeviceUi, + offbandUiInfoGet, + for (final t in tags) ...[t, 0x00], +]); + void main() { group('PrefixAllocator / splitCorrelated', () { test('allocates unique XX| tokens and skips in-flight ones', () { @@ -57,6 +77,9 @@ void main() { sent = []; connector.sendFrameOverrideForTest = sent.add; connector.setConnectedForTest(); + // A stock 1.18 radio, so the service may send frame 66 (#1158). + connector.handleFrameForTest(stock118DeviceInfo()); + sent.clear(); service = LocalCliService(connector); }); @@ -74,6 +97,39 @@ void main() { ]); } + // #1158: block the write, not only the button. + test('a radio without the device CLI: refused, nothing sent', () async { + connector.handleFrameForTest(offbandDeviceInfo()); + connector.handleFrameForTest(advert([offbandInfoTagCliRemote])); + sent.clear(); + + await expectLater( + service.run('get radio'), + throwsA( + isA().having( + (e) => e.command, + 'command', + 'get radio', + ), + ), + ); + expect( + sent.where((f) => f.isNotEmpty && f[0] == cmdRunCliCommand), + isEmpty, + ); + }); + + test('an Offband radio advertising 0x06: the command goes out', () async { + connector.handleFrameForTest(offbandDeviceInfo()); + connector.handleFrameForTest(advert([offbandInfoTagCliLocal])); + sent.clear(); + + final future = service.run('get radio'); + expect(sent.single[0], cmdRunCliCommand); + connector.handleFrameForTest(replyFor(sent.single, '> ok')); + expect((await future).text, '> ok'); + }); + test('round trip: command out, correlated reply completes it', () async { final future = service.run('get radio'); expect(sent, hasLength(1)); diff --git a/untranslated.json b/untranslated.json index 0bce3ab7..f67344f9 100644 --- a/untranslated.json +++ b/untranslated.json @@ -20,6 +20,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -420,6 +421,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -820,6 +822,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -1220,6 +1223,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -1620,6 +1624,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -2020,6 +2025,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -2420,6 +2426,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -2820,6 +2827,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -3220,6 +3228,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -3620,6 +3629,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -4020,6 +4030,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -4420,6 +4431,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -4820,6 +4832,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -5220,6 +5233,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -5620,6 +5634,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -6020,6 +6035,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy", @@ -6420,6 +6436,7 @@ "deviceCli_noReply", "deviceCli_remoteNoReply", "deviceCli_remoteUnsupported", + "deviceCli_localUnsupported", "deviceCli_sendFailed", "deviceCli_truncatedByDevice", "deviceCli_secretLongPressToCopy",