From 65f22bbea2531f7cd492d6108b8902f92b7750a8 Mon Sep 17 00:00:00 2001 From: Mika Laitio Date: Tue, 24 Jul 2012 04:39:27 +0300 Subject: [PATCH] add read_interval DeviceConfig methods get_read_interval_seconds and set_read_interval_seconds methods added. Signed-off-by: Mika Laitio --- src/DeviceConfig.cc | 11 ++++++++++- src/DeviceConfig.hh | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/DeviceConfig.cc b/src/DeviceConfig.cc index 38941f3..66fe863 100644 --- a/src/DeviceConfig.cc +++ b/src/DeviceConfig.cc @@ -18,7 +18,8 @@ using namespace std; using namespace plp; -string DeviceConfig::store_base_dir = DEFAULT_STORAGE_BASE_DIR; +string DeviceConfig::store_base_dir = DEFAULT_STORAGE_BASE_DIR; +long DeviceConfig::read_interval_seconds = 600; ConfigHandle::ConfigHandle(uci_context *ctx_param, uci_package *pkg_param, @@ -202,6 +203,14 @@ void DeviceConfig::set_base_dir_name(string store_param) { } } +long DeviceConfig::get_read_interval_seconds() { + return read_interval_seconds; +} + +void DeviceConfig::set_read_interval_seconds(long seconds_param) { + read_interval_seconds = seconds_param; +} + string DeviceConfig::get_base_dir_name() { return store_base_dir; } diff --git a/src/DeviceConfig.hh b/src/DeviceConfig.hh index 841a369..0ede135 100644 --- a/src/DeviceConfig.hh +++ b/src/DeviceConfig.hh @@ -52,6 +52,8 @@ namespace plp { virtual ~DeviceConfig(); static std::string get_base_dir_name(); static void set_base_dir_name(std::string store_param); + static long get_read_interval_seconds(); + static void set_read_interval_seconds(long seconds_param); static DeviceConfig *get_device_config(std::string device_id); std::string get_config_value(std::string key); void set_config_value(std::string key, @@ -59,6 +61,7 @@ namespace plp { EnumSummaryCalculationType get_summary_calculation_type(); private: static std::string store_base_dir; + static long read_interval_seconds; std::string device_id; std::string device_type; ConfigHandle *uci_handle; -- 2.41.1