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.

50 lines
976 B

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