From c1f4c4e77ea2da897b6f20a905a530d652444599 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Wed, 6 Apr 2011 16:55:14 +0200 Subject: [PATCH] [Listener] Check autocalibration_nb_packets Display a warning if the number of autocalibration packets to send is null. --- owlps-listener/owlps-listenerd.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/owlps-listener/owlps-listenerd.c b/owlps-listener/owlps-listenerd.c index 033fae3..813e8ed 100644 --- a/owlps-listener/owlps-listenerd.c +++ b/owlps-listener/owlps-listenerd.c @@ -481,15 +481,24 @@ void check_configuration() SET_WIFI_IFACE(GET_RTAP_IFACE()) ; } - if (GET_AUTOCALIBRATION() && GET_AUTOCALIBRATION_IP()[0] == '\0') +#ifdef USE_PTHREAD + if (GET_AUTOCALIBRATION()) { - if (GET_VERBOSE()) - fprintf(stderr, "No autocalibration IP specified, we will use" - " the aggregation IP as the destination of" - " autocalibration requests.\n") ; - SET_AUTOCALIBRATION_IP(GET_AGGREGATION_IP()) ; + if (GET_AUTOCALIBRATION_IP()[0] == '\0') + { + if (GET_VERBOSE()) + fprintf(stderr, "No autocalibration IP specified, we will" + " use the aggregation IP as the destination of" + " autocalibration requests.\n") ; + SET_AUTOCALIBRATION_IP(GET_AGGREGATION_IP()) ; + } + if (GET_AUTOCALIBRATION_NBPKT() < 1) + fprintf(stderr, "Warning! autocalibration_nb_packets is null," + " no autocalibration request will be sent!\n") ; } +#endif // USE_PTHREAD + // Port numbers // if (GET_AGGREGATION_PORT() < 1 || GET_AGGREGATION_PORT() > 65535) { @@ -505,6 +514,7 @@ void check_configuration() " failing back to the default value.\n") ; SET_LISTENING_PORT(LOC_REQUEST_DEFAULT_PORT) ; } +#ifdef USE_PTHREAD if (GET_AUTOCALIBRATION_REQUEST_PORT() < 1 || GET_AUTOCALIBRATION_REQUEST_PORT() > 65535) { @@ -521,6 +531,7 @@ void check_configuration() " failing back to the default value.\n") ; SET_AUTOCALIBRATION_PORT(DEFAULT_AUTOCALIBRATION_PORT) ; } +#endif // USE_PTHREAD }