BootEnv.hpp
1 //
2 // Created by xiong on 2022/2/25.
3 //
4 
5 #ifndef EMX_bootEnv_HPP
6 #define EMX_bootEnv_HPP
7 
8 #include "EmxCore.hpp"
9 #include <map>
10 
11 namespace Emx {
17  class BootEnv {
18  public:
19  using EnvMap = std::map<std::string, std::string>;
20 
26  static ErrCodeE GetEnv(EnvMap &map);
27 
34  static ErrCodeE GetEnv(const char *key, std::string &value);
35 
41  static ErrCodeE SetEnv(EnvMap &map);
42 
49  static ErrCodeE SetEnv(const char *key, const char *value);
50 
51  private:
52  static ErrCodeE Lock(int &fd);
53 
54  static void UnLock(int &fd);
55 
56  static void CheckCfgDir();
57  };
59 }
60 #endif //EMX_bootEnv_HPP
61 
提供应用层读写uboot环境变量的接口
Definition: BootEnv.hpp:17
std::map< std::string, std::string > EnvMap
Definition: BootEnv.hpp:19
static ErrCodeE GetEnv(const char *key, std::string &value)
获取uboot某个环境变量
static ErrCodeE SetEnv(EnvMap &map)
配置uboot环境变量
static ErrCodeE SetEnv(const char *key, const char *value)
配置uboot环境变量
static ErrCodeE GetEnv(EnvMap &map)
获取uboot全部环境变量
ErrCodeE
错误码定义
Definition: EmxTypeDef.hpp:29
Definition: EmxGpio.hpp:10