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.

44 lines
902 B

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