Updated shit
All checks were successful
Test compiling project / test (push) Successful in 2m21s

This commit is contained in:
2025-02-17 00:12:50 +01:00
parent 7c4dd280c2
commit 3b1ab2e9e9
9 changed files with 123 additions and 32 deletions

View File

@@ -11,22 +11,18 @@
class OTA {
public:
OTA(String server_url, String currentVersion, String currentDeviceConfiguration);
OTA(String server_url, Version currentVersion, String currentDeviceConfiguration);
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;
String _serverUrl;
Version _currentVersion;
String _current_device_configuration;
Firmware createErrorResponse(const String& errorMsg);
void update_started();
void update_finished();
void update_progress(int cur, int total);
void update_error(int err);
};
#endif