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.

52 lines
998 B

  1. /*
  2. OTA MODULE
  3. */
  4. #pragma once
  5. #include "espurna.h"
  6. #include <ArduinoOTA.h>
  7. #include <Updater.h>
  8. #if OTA_WEB_SUPPORT
  9. void otaWebSetup();
  10. #endif // OTA_WEB_SUPPORT == 1
  11. #if OTA_ARDUINOOTA_SUPPORT
  12. void arduinoOtaSetup();
  13. #endif // OTA_ARDUINOOTA_SUPPORT == 1
  14. #if OTA_CLIENT == OTA_CLIENT_ASYNCTCP
  15. #include <ESPAsyncTCP.h>
  16. void otaClientSetup();
  17. #endif // OTA_CLIENT == OTA_CLIENT_ASYNCTCP
  18. #if OTA_CLIENT == OTA_CLIENT_HTTPUPDATE
  19. #include <ESP8266HTTPClient.h>
  20. #include <ESP8266httpUpdate.h>
  21. void otaClientSetup();
  22. #endif // OTA_CLIENT == OTA_CLIENT_HTTPUPDATE
  23. #if SECURE_CLIENT != SECURE_CLIENT_NONE
  24. #include <WiFiClientSecure.h>
  25. #endif
  26. void otaPrintError();
  27. bool otaFinalize(size_t size, int reason, bool evenIfRemaining = false);
  28. // Helper methods from UpdaterClass that need to be called manually for async mode,
  29. // because we are not using Stream interface to feed it data.
  30. bool otaVerifyHeader(uint8_t* data, size_t len);
  31. void otaProgress(size_t bytes, size_t each = 8192u);