From 4d51d496606e755ed1d3b848e21d9c058b61bb1d Mon Sep 17 00:00:00 2001 From: mikecarper Date: Tue, 11 Aug 2026 12:19:41 -0700 Subject: [PATCH] Improve Companion terminal routing and controls --- docs/companion_radio_full.md | 36 +++- docs/telemetry_decoder.md | 14 +- docs/terminal_chat_cli.md | 47 ++++- examples/companion_radio/MyMesh.cpp | 192 +++++++++++++++--- examples/companion_radio/MyMesh.h | 15 +- src/helpers/BaseChatMesh.cpp | 41 +++- src/helpers/CLICommandUtils.h | 24 ++- src/helpers/ContactListOrder.h | 25 +++ src/helpers/RemoteCliTimeout.h | 27 +++ src/helpers/TerminalCommandTracker.h | 64 ++++++ src/helpers/TerminalDisplayFilter.h | 141 +++++++++++++ test/README.md | 3 +- .../test_cli_command_utils.cpp | 135 +++++++++++- .../test_remote_cli_reply_cache.cpp | 17 ++ 14 files changed, 709 insertions(+), 72 deletions(-) create mode 100644 src/helpers/ContactListOrder.h create mode 100644 src/helpers/RemoteCliTimeout.h create mode 100644 src/helpers/TerminalCommandTracker.h create mode 100644 src/helpers/TerminalDisplayFilter.h diff --git a/docs/companion_radio_full.md b/docs/companion_radio_full.md index 2a42ca83..7355978f 100644 --- a/docs/companion_radio_full.md +++ b/docs/companion_radio_full.md @@ -134,21 +134,43 @@ The terminal supports Companion chat commands, including `channels`, ```text channels channel #rgdata Hello from Eugene 👋 +show +show channels on to Hilltop Repeater path A1B2C3,D4E5F6 +path 7773D0 7E7662 login my-admin-password cmd ver trace ``` +The terminal `list [n]` command displays favorite contacts first and orders +each favorite/non-favorite group by its most recent advertisement. This does +not alter the binary Companion contact-list protocol. + +Unsolicited terminal output starts in a quiet mode: advertisements and +ordinary channel messages are hidden, while `#emergency` messages remain +visible. Use `show adverts on|off`, `show channels on|off`, and +`show emergency on|off` to control each category independently; plain `show` +reports their state. These runtime filters affect terminal printing only and +reset to their defaults after reboot. + The `to` command selects the remote-administration target. `path` shows its -saved outgoing route; `path direct`, `path clear`, or a comma-separated list -such as `path A1B2C3,D4E5F6` changes the route used by subsequent `login`, -`send`, and `cmd` commands. Every hop must use the same 2-, 4-, or 6-digit -hexadecimal width. Login passwords are masked during entry and limited by the -radio protocol to 15 UTF-8 bytes. Wait for the asynchronous login result before -using `cmd`; command replies appear as `CLI -> from `. Remote ACL -permissions determine which commands the target accepts. +saved outgoing route; `path direct`, `path clear`, or a list separated by +spaces, commas, or both changes the route used by subsequent `login`, `send`, +and `cmd` commands. Every hop must use the same 2-, 4-, or 6-digit hexadecimal +width. Login passwords are masked during entry and limited by the radio +protocol to 15 UTF-8 bytes. Wait for the asynchronous login result before using +`cmd`; command replies appear as `CLI -> from ` and use a response window +of 300% of the route estimate. `DIRECT via path ` displays the exact +saved prefixes copied into the packet. Remote ACL permissions determine which +commands the target accepts. The matching reply reports its round-trip time +from local queueing through result reception, including radio transit and +remote execution. Only one terminal `cmd` can be pending at a time. + +Incoming unicast replies are labeled `ROUTED`. Their exact return prefixes are +not available at the destination because each forwarder consumes its prefix; +use `trace` to verify the return route. With no argument, `trace` uses the current `to` recipient. A name-prefix argument traces that contact directly without changing the current recipient. diff --git a/docs/telemetry_decoder.md b/docs/telemetry_decoder.md index df202a2b..1145a89e 100644 --- a/docs/telemetry_decoder.md +++ b/docs/telemetry_decoder.md @@ -32,6 +32,13 @@ reply that its history is empty. ## Decode a reply
+
+ Try an example: + + + +
+