First Version to be updateable over API
All checks were successful
Test compiling project / test (push) Successful in 2m34s

This commit is contained in:
2025-02-17 21:46:20 +01:00
parent 6c4dc144d8
commit 6cec8f0a11
7 changed files with 57 additions and 7 deletions

View File

@@ -83,7 +83,7 @@ Firmware OTA::createErrorResponse(const String& errorMsg) {
};
}
void OTA::run_ota_update(String url, std::function<void()> callback_started, std::function<void()> callback_finished, std::function<void(int, int)> callback_progress, std::function<void(int)> callback_error) {
void run_ota_update(String url, std::function<void()> callback_started, std::function<void()> callback_finished, std::function<void(int, int)> callback_progress, std::function<void(int)> callback_error) {
Log.verbose("Starting OTA upgrade");
HTTPUpdate httpUpdate;
httpUpdate.onStart(callback_started);

View File

@@ -7,6 +7,7 @@
#include <Arduino.h>
#endif
#pragma once
class OTA {
@@ -15,7 +16,7 @@ class OTA {
Firmware getLatestVersionOnServer();
bool checkForUpdate();
void run_ota_update(String url, std::function<void()> callback_started, std::function<void()> callback_finished, std::function<void(int, int)> callback_progress, std::function<void(int)> callback_error);
private:
bool _isHTTPS = false;
@@ -25,4 +26,6 @@ class OTA {
Firmware createErrorResponse(const String& errorMsg);
};
void run_ota_update(String url, std::function<void()> callback_started, std::function<void()> callback_finished, std::function<void(int, int)> callback_progress, std::function<void(int)> callback_error);
#endif