From f606ae9aebc80c67a1e27df8acfa22ef37439ad9 Mon Sep 17 00:00:00 2001 From: mikecarper Date: Wed, 24 Jun 2026 17:28:19 -0700 Subject: [PATCH] Fix repeater build artifacts and recent paging --- build.sh | 4 +++- docs/cli_commands.md | 1 + docs/halo_keymind_settings.md | 1 + examples/simple_repeater/MyMesh.cpp | 3 +-- src/helpers/CommonCLI.cpp | 35 +++++++++++++++++++++++------ 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index 6a01595d..a497256d 100755 --- a/build.sh +++ b/build.sh @@ -1089,7 +1089,9 @@ collect_nrf52_artifacts() { python3 bin/uf2conv/uf2conv.py ".pio/build/${env_name}/firmware.hex" -c -o ".pio/build/${env_name}/firmware.uf2" -f 0xADA52840 || return $? copy_build_output ".pio/build/${env_name}/firmware.uf2" "out/${firmware_filename}.uf2" || return $? - copy_build_output ".pio/build/${env_name}/firmware.zip" "out/${firmware_filename}.zip" || return $? + if [ -f ".pio/build/${env_name}/firmware.zip" ]; then + copy_build_output ".pio/build/${env_name}/firmware.zip" "out/${firmware_filename}.zip" || return $? + fi } collect_stm32_artifacts() { diff --git a/docs/cli_commands.md b/docs/cli_commands.md index fe3464c3..bfbeb8cb 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -1439,6 +1439,7 @@ set direct.retry.cr 20.0,12.0,6.0,2.0 **Usage:** - `get recent.repeater` - `get recent.repeater ` +- `get recent.repeaters ` - `set recent.repeater [snr_db]` - `clear recent.repeater` diff --git a/docs/halo_keymind_settings.md b/docs/halo_keymind_settings.md index 62bc4779..18400104 100644 --- a/docs/halo_keymind_settings.md +++ b/docs/halo_keymind_settings.md @@ -122,6 +122,7 @@ Show learned rows: ```text get recent.repeater get recent.repeater 2 +get recent.repeaters 2 get recent.repeater page 3 ``` diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index 8f301412..06cc31f9 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -3076,8 +3076,7 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, ClientInfo* sender, char * } } } else if (sender_timestamp == 0 && sender == NULL - && memcmp(command, "get recent.repeater", 19) == 0 - && (command[19] == 0 || command[19] == ' ')) { + && (strcmp(command, "get recent.repeater") == 0 || strcmp(command, "get recent.repeaters") == 0)) { printRecentRepeatersSerial(); reply_start[0] = 0; } else if (sender_timestamp == 0 && strcmp(command, "get acl") == 0) { diff --git a/src/helpers/CommonCLI.cpp b/src/helpers/CommonCLI.cpp index 788e4b33..bb06542f 100644 --- a/src/helpers/CommonCLI.cpp +++ b/src/helpers/CommonCLI.cpp @@ -47,6 +47,31 @@ static uint32_t _atoi(const char* sp) { return n; } +static bool parseRecentRepeaterGet(const char* config, int& page) { + if (strncmp(config, "recent.repeater", 15) != 0) { + return false; + } + + const char* cursor = &config[15]; + if (*cursor == 's') { + cursor++; + } + if (*cursor != 0 && *cursor != ' ') { + return false; + } + + while (*cursor == ' ') cursor++; + if (strncmp(cursor, "page", 4) == 0 && (cursor[4] == 0 || cursor[4] == ' ')) { + cursor += 4; + while (*cursor == ' ') cursor++; + } + + page = 1; + if (*cursor) page = _atoi(cursor); + if (page < 1) page = 1; + return true; +} + static bool isValidName(const char *n) { while (*n) { if (*n == '[' || *n == ']' || *n == '\\' || *n == ':' || *n == ',' || *n == '?' || *n == '*') return false; @@ -1617,6 +1642,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* reply) { const char* config = &command[4]; + int recent_page = 1; if (memcmp(config, "dutycycle", 9) == 0) { float dc = 100.0f / (_prefs->airtime_factor + 1.0f); int dc_int = (int)dc; @@ -1735,13 +1761,8 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep formatSnrDbX4(cr8, sizeof(cr8), _prefs->direct_retry_cr8_snr_x4); sprintf(reply, "> %s,%s,%s,%s", cr4, cr5, cr7, cr8); } - } else if (memcmp(config, "recent.repeater", 15) == 0) { - int page = 1; - const char* cursor = &config[15]; - while (*cursor == ' ') cursor++; - if (*cursor) page = _atoi(cursor); - if (page < 1) page = 1; - _callbacks->formatRecentRepeatersReply(reply, page); + } else if (parseRecentRepeaterGet(config, recent_page)) { + _callbacks->formatRecentRepeatersReply(reply, recent_page); } else if (memcmp(config, "owner.info", 10) == 0) { auto start = reply; *reply++ = '>';