From 858241bd570a1be7d7e2f0a5d500d214d19d6c0e Mon Sep 17 00:00:00 2001 From: Djuri Baars Date: Sat, 18 May 2024 23:00:08 +0200 Subject: [PATCH] Add HW revision to mDNS for updates --- src/lib/config.cpp | 10 +++++++++- src/lib/config.hpp | 3 ++- src/lib/webserver.cpp | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/config.cpp b/src/lib/config.cpp index 893d773..95ca5ab 100644 --- a/src/lib/config.cpp +++ b/src/lib/config.cpp @@ -716,4 +716,12 @@ void setupFrontlight() // } flArray.allOFF(); } -#endif \ No newline at end of file +#endif + +String getHwRev() { + #ifndef HW_REV + return "REV_0"; + #else + return HW_REV; + #endif +} \ No newline at end of file diff --git a/src/lib/config.hpp b/src/lib/config.hpp index e5a59f1..f7ca85b 100644 --- a/src/lib/config.hpp +++ b/src/lib/config.hpp @@ -62,4 +62,5 @@ void improv_set_state(improv::State state); void improv_send_response(std::vector &response); void improv_set_error(improv::Error error); -void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info); \ No newline at end of file +void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info); +String getHwRev(); \ No newline at end of file diff --git a/src/lib/webserver.cpp b/src/lib/webserver.cpp index 371f17b..425c7fc 100644 --- a/src/lib/webserver.cpp +++ b/src/lib/webserver.cpp @@ -94,6 +94,7 @@ void setupWebserver() { MDNS.addServiceTxt("http", "tcp", "model", "BTClock"); MDNS.addServiceTxt("http", "tcp", "version", "3.0"); MDNS.addServiceTxt("http", "tcp", "rev", GIT_REV); + MDNS.addServiceTxt("http", "tcp", "hw_rev", getHwRev()); } xTaskCreate(eventSourceTask, "eventSourceTask", 4096, NULL, tskIDLE_PRIORITY,