2025-01-23 11:13:58 +08:00
|
|
|
#ifndef UPGRADE_CFG_HPP_
|
|
|
|
|
#define UPGRADE_CFG_HPP_
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
#define UPGRADE_CONFIG "/opt/configenv/upgrade.json"
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
int try_times;
|
|
|
|
|
std::string sensor_type;
|
|
|
|
|
int hw_version;
|
|
|
|
|
std::string current_sw_version;
|
|
|
|
|
std::string upgrade_sw_version;
|
|
|
|
|
std::string submit_time;
|
|
|
|
|
std::vector<std::string> try_world_time1;
|
|
|
|
|
} UpgradeInfo;
|
|
|
|
|
|
|
|
|
|
class UpgradeCfg {
|
|
|
|
|
public:
|
|
|
|
|
static int ReadCfg(std::map<int, UpgradeInfo> &upgrade);
|
|
|
|
|
static int WriteCfg(std::map<int, UpgradeInfo> &upgrade);
|
|
|
|
|
static void ClearCfg();
|
|
|
|
|
};
|
|
|
|
|
|
2024-11-05 14:44:08 +08:00
|
|
|
#endif // UPGRADE_CFG_HPP_
|