From: Mika Laitio Date: Tue, 24 Jul 2012 01:41:15 +0000 (+0300) Subject: use read interval seconds param when polling data X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a8b20a415bc08942286f0c825f28a67cb859de83;p=libplpdevicebus.git use read interval seconds param when polling data Signed-off-by: Mika Laitio --- 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); }