cli: add LoRa snapshot status, test-display command

Dieser Commit ist enthalten in:
tom committed 2026-10-20 22:10:29 +02:00
1 Ursprung 1d22bcb4ce
Commit 4823f519b2
2 Dateien geändert
+25

Keine Dateien entsprechen Ihrer Suche

+1
Datei anzeigen
@@ -43,3 +43,4 @@ build_src_flags =
-Wno-include-next -Wno-include-next
; Promotes all warnings to hard compilation errors to guarantee clean code ; Promotes all warnings to hard compilation errors to guarantee clean code
;-Werror ;-Werror
;-D MATH_COMPARE=1
+24
Datei anzeigen
@@ -19,6 +19,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "config.hpp" #include "config.hpp"
#include "lora.hpp" #include "lora.hpp"
#include "display.hpp"
static const char* TAG = "CLI"; static const char* TAG = "CLI";
static i2c* i2c_bus = nullptr; static i2c* i2c_bus = nullptr;
@@ -91,6 +92,7 @@ void process_command(const char* cmd) {
printf(" freq <hz> - Set dynamic radio frequency (433 / 868 MHz bounds)\r\n"); printf(" freq <hz> - Set dynamic radio frequency (433 / 868 MHz bounds)\r\n");
printf(" bw <62|125|250|500>- Set dynamic LoRa bandwidth in kHz\r\n"); printf(" bw <62|125|250|500>- Set dynamic LoRa bandwidth in kHz\r\n");
printf(" i2c - Scan the configured I2C bus infrastructure\r\n"); printf(" i2c - Scan the configured I2C bus infrastructure\r\n");
printf(" test-display - Run a comprehensive visual test suite\r\n");
} }
else if (strcmp(cmd, "version") == 0) { else if (strcmp(cmd, "version") == 0) {
printf("%s System - Running Version: %s\r\n", Config::PROJECT_TITLE, Config::PROJECT_VERSION); printf("%s System - Running Version: %s\r\n", Config::PROJECT_TITLE, Config::PROJECT_VERSION);
@@ -101,6 +103,23 @@ void process_command(const char* cmd) {
printf("Mute Timer Period : %lu seconds\r\n", (unsigned long)current_mute_time_sec); printf("Mute Timer Period : %lu seconds\r\n", (unsigned long)current_mute_time_sec);
printf("Target CPU Board : ESP32\r\n"); printf("Target CPU Board : ESP32\r\n");
printf("ESP-IDF Version : %s\r\n", esp_get_idf_version()); printf("ESP-IDF Version : %s\r\n", esp_get_idf_version());
if (lora_system != nullptr) {
// atomar, thread-safe copy of telemtry data (stack allocation)
LoraStateSnapshot snapshot = lora_system->getSnapshot();
printf("LoRa Hardware : %s\r\n", snapshot.isInitialized ? "INITIALIZED" : "FAILED / UNINITIALIZED");
printf("LoRa Transceiver : Mode [%s]\r\n", snapshot.currentModeStr);
printf("LoRa Frequency : %lu Hz\r\n", (unsigned long)snapshot.frequencyHz);
printf("LoRa Bandwidth : %lu kHz\r\n", (unsigned long)snapshot.bandwidthKhz);
printf("LoRa SpreadingFact: SF%u\r\n", snapshot.spreadingFactor);
printf("LoRa Coding Rate : 4/%u\r\n", snapshot.codingRate);
printf("Packets Received : %lu\r\n", (unsigned long)snapshot.totalPacketsReceived);
printf("Packets Transmit : %lu\r\n", (unsigned long)snapshot.totalPacketsTransmitted);
printf("History In Memory : %zu Packets\r\n", snapshot.currentHistoryCount);
} else {
printf("LoRa Snapshot : Error (LoraController Handle uninitialized)\r\n");
}
} }
else if (strncmp(cmd, "mute ", 5) == 0) { else if (strncmp(cmd, "mute ", 5) == 0) {
int parsed_time = atoi(cmd + 5); int parsed_time = atoi(cmd + 5);
@@ -220,6 +239,11 @@ void process_command(const char* cmd) {
printf("Error: I2C Bus not initialized in CLI!\r\n"); printf("Error: I2C Bus not initialized in CLI!\r\n");
} }
} }
else if (strcmp(cmd, "test-display") == 0) {
printf("[CLI] Triggering asynchronous OLED font verification...\n");
run_display_font_test(oled_display);
printf("[CLI] Test completed.\n");
}
else { else {
printf("Unknown command: '%s'. Type 'help' for options.\r\n", cmd); printf("Unknown command: '%s'. Type 'help' for options.\r\n", cmd);
} }