From 805dafb3630bf92537ea06aa57a8a60b141d41d3 Mon Sep 17 00:00:00 2001 From: Robert Ekl Date: Tue, 17 Mar 2026 12:58:51 -0500 Subject: [PATCH] fix: align bridge.source CLI names --- docs/cli_commands.md | 2 ++ src/helpers/CommonCLI.cpp | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/cli_commands.md b/docs/cli_commands.md index e5cca0ea1b..d31db51e17 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -901,6 +901,8 @@ region save - `logRx`: bridges received packets - `logTx`: bridges transmitted packets +**Compatibility:** `rx` and `tx` are also accepted as legacy aliases for `logRx` and `logTx` + **Default:** `logTx` --- diff --git a/src/helpers/CommonCLI.cpp b/src/helpers/CommonCLI.cpp index 2f7a0fffcb..4dc1c1e784 100644 --- a/src/helpers/CommonCLI.cpp +++ b/src/helpers/CommonCLI.cpp @@ -652,9 +652,18 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch strcpy(reply, "Error: delay must be between 0-10000 ms"); } } else if (memcmp(config, "bridge.source ", 14) == 0) { - _prefs->bridge_pkt_src = memcmp(&config[14], "rx", 2) == 0; - savePrefs(); - strcpy(reply, "OK"); + const char* source = &config[14]; + if (strcmp(source, "logRx") == 0 || strcmp(source, "rx") == 0) { + _prefs->bridge_pkt_src = true; + savePrefs(); + strcpy(reply, "OK"); + } else if (strcmp(source, "logTx") == 0 || strcmp(source, "tx") == 0) { + _prefs->bridge_pkt_src = false; + savePrefs(); + strcpy(reply, "OK"); + } else { + strcpy(reply, "Error: source must be logRx or logTx"); + } #endif #ifdef WITH_RS232_BRIDGE } else if (memcmp(config, "bridge.baud ", 12) == 0) {