From a8b20a415bc08942286f0c825f28a67cb859de83 Mon Sep 17 00:00:00 2001 From: Mika Laitio Date: Tue, 24 Jul 2012 04:41:15 +0300 Subject: [PATCH] use read interval seconds param when polling data Signed-off-by: Mika Laitio --- src_server/DeviceManagerServer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src_server/DeviceManagerServer.cc b/src_server/DeviceManagerServer.cc index 53b5a49..8257561 100644 --- a/src_server/DeviceManagerServer.cc +++ b/src_server/DeviceManagerServer.cc @@ -25,7 +25,11 @@ static void *device_data_reader_thread(void *thread_args_pointer) { list::iterator list_iter; Device *device; SensorDevice *sensor; + long read_int_sec; + read_int_sec = DeviceConfig::get_read_interval_seconds(); + if (read_int_sec < 0) + read_int_sec = 600; _dev_lst = (list *)thread_args_pointer; while(1) { for (list_iter = _dev_lst->begin(); list_iter != _dev_lst->end(); list_iter++) { @@ -33,9 +37,9 @@ static void *device_data_reader_thread(void *thread_args_pointer) { sensor = dynamic_cast(device); if (sensor != NULL) { sensor->get_data(); - sleep(60); } } + sleep(read_int_sec); } pthread_exit(NULL); } -- 2.41.1