From a3b7701bc0231b526fec4758385cc8e61346da9d Mon Sep 17 00:00:00 2001 From: Scott Powell Date: Fri, 24 Jan 2025 22:00:13 +1100 Subject: [PATCH] * added 'ver' command to CLI (repeater and room server) --- examples/simple_repeater/main.cpp | 6 +++++- examples/simple_room_server/main.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index 29187afd..2d441e6c 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -18,6 +18,8 @@ /* ------------------------------ Config -------------------------------- */ +#define FIRMWARE_VER_TEXT "v1 (build: 24 Jan 2025)" + #ifndef LORA_FREQ #define LORA_FREQ 915.0 #endif @@ -389,8 +391,10 @@ public: } else { sprintf(reply, "unknown config: %s", &command[4]); } + } else if (memcmp(command, "ver", 3) == 0) { + strcpy(reply, FIRMWARE_VER_TEXT); } else { - sprintf(reply, "Unknown: %s (commands: reboot, advert, clock, set)", command); + sprintf(reply, "Unknown: %s (commands: reboot, advert, clock, set, ver)", command); } } }; diff --git a/examples/simple_room_server/main.cpp b/examples/simple_room_server/main.cpp index 02b8dc46..c885bac7 100644 --- a/examples/simple_room_server/main.cpp +++ b/examples/simple_room_server/main.cpp @@ -18,6 +18,8 @@ /* ------------------------------ Config -------------------------------- */ +#define FIRMWARE_VER_TEXT "v1 (build: 24 Jan 2025)" + #ifndef LORA_FREQ #define LORA_FREQ 915.0 #endif @@ -466,6 +468,8 @@ public: } else { sprintf(reply, "unknown config: %s", &command[4]); } + } else if (memcmp(command, "ver", 3) == 0) { + strcpy(reply, FIRMWARE_VER_TEXT); } else { // unknown command reply[0] = 0;