Skip to content

Commit 01656d3

Browse files
committed
Add 'version' command, ping now returns version in response
1 parent 96f26c5 commit 01656d3

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

ESP32C5/main/main.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,7 @@ static int cmd_list_probes_vendor(int argc, char **argv);
12691269
static int cmd_sniffer_debug(int argc, char **argv);
12701270
static int cmd_start_blackout(int argc, char **argv);
12711271
static int cmd_ping(int argc, char **argv);
1272+
static int cmd_version(int argc, char **argv);
12721273
static int cmd_boot_button(int argc, char **argv);
12731274
static int cmd_start_portal(int argc, char **argv);
12741275
static int cmd_start_rogueap(int argc, char **argv);
@@ -10304,7 +10305,13 @@ static int cmd_reboot(int argc, char **argv)
1030410305

1030510306
static int cmd_ping(int argc, char **argv) {
1030610307
(void)argc; (void)argv;
10307-
MY_LOG_INFO(TAG, "pong");
10308+
MY_LOG_INFO(TAG, "pong v" JANOS_VERSION);
10309+
return 0;
10310+
}
10311+
10312+
static int cmd_version(int argc, char **argv) {
10313+
(void)argc; (void)argv;
10314+
MY_LOG_INFO(TAG, "JanOS version: " JANOS_VERSION);
1030810315
return 0;
1030910316
}
1031010317

@@ -14388,6 +14395,15 @@ static void register_commands(void)
1438814395
};
1438914396
ESP_ERROR_CHECK(esp_console_cmd_register(&ping_cmd));
1439014397

14398+
const esp_console_cmd_t version_cmd = {
14399+
.command = "version",
14400+
.help = "Print firmware version",
14401+
.hint = NULL,
14402+
.func = &cmd_version,
14403+
.argtable = NULL
14404+
};
14405+
ESP_ERROR_CHECK(esp_console_cmd_register(&version_cmd));
14406+
1439114407
const esp_console_cmd_t list_sd_cmd = {
1439214408
.command = "list_sd",
1439314409
.help = "Lists HTML files on SD card",

0 commit comments

Comments
 (0)