diff --git a/firmware/lib/wifimanager/WifiManager.h b/firmware/lib/wifimanager/WifiManager.h index 7403643..5494692 100644 --- a/firmware/lib/wifimanager/WifiManager.h +++ b/firmware/lib/wifimanager/WifiManager.h @@ -41,6 +41,7 @@ public: State state() const { return state_; } const char *stateStr() const { return stateToString(state_); } + const String & hostname() const { return hostname_; } static const char *stateToString(State state); private: diff --git a/firmware/src/SessionAPI.h b/firmware/src/SessionAPI.h index fa42937..ab32caf 100644 --- a/firmware/src/SessionAPI.h +++ b/firmware/src/SessionAPI.h @@ -83,7 +83,6 @@ template bool SessionAPI::handleMessage(websockets::WebsocketsClient &client, MessageCode code, const char *payload, size_t size) { - Serial.println("Handling message in SessionAPI"); switch (code) { case MessageCode::START_SESSION: diff --git a/firmware/src/WifiAPI.cpp b/firmware/src/WifiAPI.cpp index 268ab77..1f778d2 100644 --- a/firmware/src/WifiAPI.cpp +++ b/firmware/src/WifiAPI.cpp @@ -7,7 +7,8 @@ void WifiAPI::sendWifiState(websockets::WebsocketsClient &client) { StaticJsonDocument<128> data; data["state"] = wifiManager_.stateStr(); - sendToClient<64>(client, MessageCode::WIFI_STATE_RESPONSE, data); + data["hostname"] = wifiManager_.hostname(); + sendToClient<192>(client, MessageCode::WIFI_STATE_RESPONSE, data); } void WifiAPI::onClientConnect(websockets::WebsocketsClient &client)