#ifndef UNIT_TEST #include #ifdef UNIT_TEST #include #else #include #endif class OTA { public: OTA(String server_url, String currentVersion, String currentDeviceConfiguration); Firmware getLatestVersionOnServer(); bool checkForUpdate(); void run_ota_update(String url, std::function callback_started, std::function callback_finished, std::function callback_progress, std::function 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