Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
868 B

  1. /*
  2. WEBSERVER MODULE
  3. Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
  4. */
  5. #pragma once
  6. #include <functional>
  7. #if WEB_SUPPORT
  8. #include <ESPAsyncTCP.h>
  9. #include <ESPAsyncWebServer.h>
  10. #include <Hash.h>
  11. #include <FS.h>
  12. #include <AsyncJson.h>
  13. #include <ArduinoJson.h>
  14. #else
  15. // TODO: need these prototypes for .ino
  16. class AsyncClient;
  17. class AsyncWebServer;
  18. class AsyncWebServerRequest;
  19. class ArRequestHandlerFunction;
  20. class AsyncWebSocketClient;
  21. class AsyncWebSocket;
  22. class AwsEventType;
  23. #endif // WEB_SUPPORT == 1
  24. using web_body_callback_f = std::function<bool(AsyncWebServerRequest*, uint8_t* data, size_t len, size_t index, size_t total)>;
  25. using web_request_callback_f = std::function<bool(AsyncWebServerRequest*)>;
  26. AsyncWebServer* webServer();
  27. void webBodyRegister(web_body_callback_f);
  28. void webRequestRegister(web_request_callback_f);