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.

49 lines
944 B

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