4 * Created on: Dec 9, 2010
8 #ifndef DEVICECONFIG_HH_
9 #define DEVICECONFIG_HH_
15 #include <plp/config.h>
18 #define DEVICE_CONFIG__FILE_NAME "dev_cfg.txt"
19 #define DEVICE_CONFIG__SECTION_TYPE "device"
20 #define DEVICE_CONFIG__SECTION_NAME "base_data"
21 #define DEVICE_CONFIG_VALUE_KEY__TYPE "type"
22 #define DEVICE_CONFIG_VALUE_KEY__NAME "name"
25 enum enum_summary_calculation {SUM, DELTA, MEAN, MAX, MIN};
29 ConfigHandle(uci_context *ctx_param, uci_package *pkg_param);
31 struct uci_context *ctx;
32 struct uci_package *pkg;
37 DeviceConfig(std::string device_id_param);
38 virtual ~DeviceConfig();
39 static std::string get_base_dir_name();
40 static void set_base_dir_name(std::string store_param);
41 std::string get_cfg_value(std::string key);
42 void set_cfg_value(std::string key, std::string value);
43 enum_summary_calculation get_summary_calculation_type();
45 static std::string store_base_dir;
46 std::string device_id;
47 std::string device_type;
48 ConfigHandle *uci_handle;
49 ConfigHandle *load_device_config(std::string device_id_param);
50 std::string get_dir_name(std::string device_id);
51 std::string get_file_name(std::string device_id_param);
55 #endif /* DEVICECONFIG_HH_ */