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.

38 lines
808 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 "espurna.h"
  7. #if WEB_SUPPORT
  8. #include <functional>
  9. #include <ESPAsyncTCP.h>
  10. #include <ESPAsyncWebServer.h>
  11. #include <Hash.h>
  12. #include <FS.h>
  13. #include <AsyncJson.h>
  14. #include <ArduinoJson.h>
  15. using web_body_callback_f = std::function<bool(AsyncWebServerRequest*, uint8_t* data, size_t len, size_t index, size_t total)>;
  16. using web_request_callback_f = std::function<bool(AsyncWebServerRequest*)>;
  17. AsyncWebServer* webServer();
  18. bool webAuthenticate(AsyncWebServerRequest *request);
  19. void webLog(AsyncWebServerRequest *request);
  20. void webBodyRegister(web_body_callback_f);
  21. void webRequestRegister(web_request_callback_f);
  22. uint16_t webPort();
  23. void webSetup();
  24. #endif // WEB_SUPPORT == 1