更新Wi-Fi组件版本,从OTA接口读取Websocket服务器

This commit is contained in:
Terrence
2025-04-21 15:12:52 +08:00
parent c380617cca
commit 3404180a77
15 changed files with 67 additions and 58 deletions

View File

@@ -13,13 +13,13 @@ public:
Ota();
~Ota();
void SetCheckVersionUrl(std::string check_version_url);
void SetHeader(const std::string& key, const std::string& value);
bool CheckVersion();
esp_err_t Activate();
bool HasActivationChallenge() { return has_activation_challenge_; }
bool HasNewVersion() { return has_new_version_; }
bool HasMqttConfig() { return has_mqtt_config_; }
bool HasWebsocketConfig() { return has_websocket_config_; }
bool HasActivationCode() { return has_activation_code_; }
bool HasServerTime() { return has_server_time_; }
void StartUpgrade(std::function<void(int progress, size_t speed)> callback);
@@ -29,6 +29,7 @@ public:
const std::string& GetCurrentVersion() const { return current_version_; }
const std::string& GetActivationMessage() const { return activation_message_; }
const std::string& GetActivationCode() const { return activation_code_; }
const std::string& GetCheckVersionUrl() const { return check_version_url_; }
private:
std::string check_version_url_;
@@ -36,6 +37,7 @@ private:
std::string activation_code_;
bool has_new_version_ = false;
bool has_mqtt_config_ = false;
bool has_websocket_config_ = false;
bool has_server_time_ = false;
bool has_activation_code_ = false;
bool has_serial_number_ = false;