diff --git a/src/AsyncEventSource.cpp b/src/AsyncEventSource.cpp index 66daa77..639fd56 100644 --- a/src/AsyncEventSource.cpp +++ b/src/AsyncEventSource.cpp @@ -24,6 +24,8 @@ #include "AsyncEventSource.h" #include "literals.h" +using namespace asyncsrv; + static String generateEventMessage(const char* message, const char* event, uint32_t id, uint32_t reconnect) { String ev; diff --git a/src/AsyncWebSocket.cpp b/src/AsyncWebSocket.cpp index fab986f..88d88ec 100644 --- a/src/AsyncWebSocket.cpp +++ b/src/AsyncWebSocket.cpp @@ -38,6 +38,9 @@ #define MAX_PRINTF_LEN 64 +using namespace asyncsrv; + + size_t webSocketSendFrameWindow(AsyncClient* client) { if (!client->canSend()) return 0; diff --git a/src/ESPAsyncWebServer.h b/src/ESPAsyncWebServer.h index ec5311c..8499c50 100644 --- a/src/ESPAsyncWebServer.h +++ b/src/ESPAsyncWebServer.h @@ -153,7 +153,7 @@ class AsyncWebHeader { const String& name() const { return _name; } const String& value() const { return _value; } - String toString() const { return _name + (char)0x3a + (char)0x20 /*": "*/ + _value + T_rn; } + String toString() const { return _name + (char)0x3a + (char)0x20 /*": "*/ + _value + asyncsrv::T_rn; } }; /* diff --git a/src/WebAuthentication.cpp b/src/WebAuthentication.cpp index 14a7729..b5962fc 100644 --- a/src/WebAuthentication.cpp +++ b/src/WebAuthentication.cpp @@ -27,6 +27,8 @@ #endif #include "literals.h" +using namespace asyncsrv; + // Basic Auth hash = base64("username:password") bool checkBasicAuthentication(const char* hash, const char* username, const char* password) { diff --git a/src/WebHandlers.cpp b/src/WebHandlers.cpp index 41399b8..580ceba 100644 --- a/src/WebHandlers.cpp +++ b/src/WebHandlers.cpp @@ -21,6 +21,9 @@ #include "ESPAsyncWebServer.h" #include "WebHandlerImpl.h" +using namespace asyncsrv; + + AsyncStaticWebHandler::AsyncStaticWebHandler(const char* uri, FS& fs, const char* path, const char* cache_control) : _fs(fs), _uri(uri), _path(path), _default_file(F("index.htm")), _cache_control(cache_control), _last_modified(), _callback(nullptr) { // Ensure leading '/' diff --git a/src/WebRequest.cpp b/src/WebRequest.cpp index 9292000..f0d6bdf 100644 --- a/src/WebRequest.cpp +++ b/src/WebRequest.cpp @@ -26,6 +26,8 @@ #define __is_param_char(c) ((c) && ((c) != '{') && ((c) != '[') && ((c) != '&') && ((c) != '=')) +using namespace asyncsrv; + enum { PARSE_REQ_START, PARSE_REQ_HEADERS, PARSE_REQ_BODY, diff --git a/src/WebResponses.cpp b/src/WebResponses.cpp index a06ae78..86aa947 100644 --- a/src/WebResponses.cpp +++ b/src/WebResponses.cpp @@ -22,6 +22,8 @@ #include "WebResponseImpl.h" #include "cbuf.h" +using namespace asyncsrv; + // Since ESP8266 does not link memchr by default, here's its implementation. void* memchr(void* ptr, int ch, size_t count) { unsigned char* p = static_cast(ptr); diff --git a/src/WebServer.cpp b/src/WebServer.cpp index bc48b46..0e29a54 100644 --- a/src/WebServer.cpp +++ b/src/WebServer.cpp @@ -21,6 +21,8 @@ #include "ESPAsyncWebServer.h" #include "WebHandlerImpl.h" +using namespace asyncsrv; + bool ON_STA_FILTER(AsyncWebServerRequest* request) { return WiFi.localIP() == request->client()->localIP(); } diff --git a/src/literals.h b/src/literals.h index 50bd03a..145d69b 100644 --- a/src/literals.h +++ b/src/literals.h @@ -1,5 +1,6 @@ #pragma once +namespace asyncsrv { #ifndef ESP8622 static constexpr const char* T_100_CONTINUE = "100-continue"; @@ -336,3 +337,5 @@ static const char T_uri[] PROGMEM = "uri"; static const char T_username[] PROGMEM = "username"; #endif // ESP8622 + +} // namespace asyncsrv {}