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__ID "id"
23 #define DEVICE_CONFIG_VALUE_KEY__NAME "name"
26 enum enum_summary_calculation {SUM, DELTA, MIN, MAX, MEAN};
30 ConfigHandle(uci_context *ctx_param, uci_package *pkg_param);
32 struct uci_context *ctx;
33 struct uci_package *pkg;
38 DeviceConfig(std::string device_id_param);
39 virtual ~DeviceConfig();
40 static std::string get_base_dir_name();
41 static void set_base_dir_name(std::string store_param);
42 std::string get_cfg_value(std::string key);
43 void set_cfg_value(std::string key, std::string value);
44 enum_summary_calculation get_summary_calculation_type();
46 static std::string store_base_dir;
47 std::string device_id;
48 std::string device_type;
49 ConfigHandle *uci_handle;
50 ConfigHandle *load_device_config(std::string device_id_param);
51 std::string get_dir_name(std::string device_id);
52 std::string get_file_name(std::string device_id_param);
56 #endif /* DEVICECONFIG_HH_ */