From f5895f23c4bc2f5e1cb70b00e6ad622b183b0a8d Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Sun, 24 Jul 2011 20:20:32 +0200 Subject: [PATCH] [Aggregator] check_interval in ms The check interval is now in milliseconds instead of microseconds. --- owlps-aggregator/owlps-aggregator.h | 6 +++--- owlps-aggregator/owlps-aggregatord.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/owlps-aggregator/owlps-aggregator.h b/owlps-aggregator/owlps-aggregator.h index d69f01b..930ce88 100644 --- a/owlps-aggregator/owlps-aggregator.h +++ b/owlps-aggregator/owlps-aggregator.h @@ -13,9 +13,9 @@ #define DEFAULT_CONFIG_FILE "/usr/local/etc/owlps/owlps-aggregator.conf" #define DEFAULT_AGGREGATE_TIMEOUT 1500 // milliseconds #define DEFAULT_KEEP_TIMEOUT 3000 // milliseconds -#define DEFAULT_CHECK_INTERVAL 500000 // microseconds -#define DEFAULT_AP_KEEP_TIMEOUT 600 // s -#define DEFAULT_AP_CHECK_INTERVAL 1000 // ms +#define DEFAULT_CHECK_INTERVAL 500 // milliseconds +#define DEFAULT_AP_KEEP_TIMEOUT 600 // seconds +#define DEFAULT_AP_CHECK_INTERVAL 1000 // milliseconds #define POSITIONER_DEFAULT_IP "127.0.0.1" diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 761906b..98a12b2 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -190,7 +190,7 @@ void parse_config_file(int argc, char **argv) CFG_INT("aggregate_timeout", DEFAULT_AGGREGATE_TIMEOUT, CFGF_NONE), CFG_INT("keep_timeout", DEFAULT_KEEP_TIMEOUT, CFGF_NONE), - // Time between two list checks (in microseconds): + // Time between two list checks (in milliseconds): CFG_INT("check_interval", DEFAULT_CHECK_INTERVAL, CFGF_NONE), // Autocalibration activated? @@ -678,7 +678,8 @@ void* monitor_requests(void *NULL_value) sem_post(&lock_requests) ; fflush(NULL) ; - usleep(cfg_getint(cfg, "check_interval")) ; // Wait to check again + // Wait to check again: + usleep(cfg_getint(cfg, "check_interval") * 1000) ; } /* Close output file & socket */ @@ -1312,7 +1313,7 @@ void print_usage() "\t-k keep_timeout\t\tAggregated requests are kept during" " 'keep_timeout' milliseconds (default: %d ms).\n" "\t-c check_interval\tTime between two checks of the stored" - " requests (default\t%d microseconds).\n" + " requests, in milliseconds (default: %d ms).\n" "Autocalibration options:\n" "\t-A\t\t\tEnable autocalibration (default: disabled).\n"