diff --git a/src/esphttpdutils.cpp b/src/esphttpdutils.cpp index d3d1f97..bbc2ff5 100644 --- a/src/esphttpdutils.cpp +++ b/src/esphttpdutils.cpp @@ -95,6 +95,7 @@ std::expected webserver_get_query(httpd_req_t *req) return query; } +#ifdef CONFIG_HTTPD_WS_SUPPORT std::string toString(httpd_ws_type_t val) { switch (val) @@ -109,6 +110,7 @@ std::string toString(httpd_ws_type_t val) ESP_LOGW(TAG, "Unknown httpd_ws_type_t(%i)", std::to_underlying(val)); return std::format("Unknown httpd_ws_type_t({})", std::to_underlying(val)); } +#endif // CONFIG_HTTPD_WS_SUPPORT } // namespace esphttpdutils diff --git a/src/esphttpdutils.h b/src/esphttpdutils.h index 3307df9..514c984 100644 --- a/src/esphttpdutils.h +++ b/src/esphttpdutils.h @@ -26,6 +26,8 @@ esp_err_t webserver_resp_send(httpd_req_t *req, ResponseStatus error, const char std::expected webserver_get_query(httpd_req_t *req); +#ifdef CONFIG_HTTPD_WS_SUPPORT std::string toString(httpd_ws_type_t val); +#endif // CONFIG_HTTPD_WS_SUPPORT } // namespace esphttpdutils