#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();
};

#endif // UPGRADE_CFG_HPP_