diff --git a/infrastructure-centred/owlps-listener/owlps-listenerd.c b/infrastructure-centred/owlps-listener/owlps-listenerd.c index d6152aa..34ab079 100644 --- a/infrastructure-centred/owlps-listener/owlps-listenerd.c +++ b/infrastructure-centred/owlps-listener/owlps-listenerd.c @@ -354,6 +354,7 @@ void check_configuration() print_usage() ; exit(ERR_BAD_USAGE) ; } + if (GET_RTAP_IFACE()[0] == '\0') { fprintf(stderr, "Error! You must specify a radiotap interface" @@ -361,15 +362,16 @@ void check_configuration() print_usage() ; exit(ERR_BAD_USAGE) ; } + if (GET_WIFI_IFACE()[0] == '\0') { -#ifdef DEBUG - fprintf(stderr, "Warning! No Wi-Fi was specified. Failing back to" - " the radiotap interface (%s) instead.\n", - GET_RTAP_IFACE()) ; -#endif // DEBUG + if (GET_VERBOSE()) + fprintf(stderr, "No Wi-Fi interface was specified. Failing back" + " to the radiotap interface (%s) instead.\n", + GET_RTAP_IFACE()) ; SET_WIFI_IFACE(GET_RTAP_IFACE()) ; } + } @@ -429,9 +431,8 @@ void print_configuration() */ void keep_mode_monitor(char *iface) { -#ifdef DEBUG - fprintf(stderr, "Thread for keeping monitor mode launched.\n") ; -#endif // DEBUG + if (GET_VERBOSE()) + fprintf(stderr, "Thread for keeping monitor mode launched.\n") ; while (run) { @@ -885,9 +886,8 @@ void autocalibrate_hello() struct sockaddr_in serv; autocalibration_hello message ; -#ifdef DEBUG - fprintf(stderr, "Autocalibration Hello thread launched.\n") ; -#endif // DEBUG + if (GET_VERBOSE()) + fprintf(stderr, "Autocalibration Hello thread launched.\n") ; send_sockfd = owlps_create_socket_to_aggregator(GET_AGGREGATION_IP(), @@ -916,9 +916,8 @@ void autocalibrate() int listen_sockfd ; autocalibration_order message ; -#ifdef DEBUG - fprintf(stderr, "Autocalibration thread launched.\n") ; -#endif // DEBUG + if (GET_VERBOSE()) + fprintf(stderr, "Autocalibration thread launched.\n") ; // Socket to send autocalibration positioning requests autocalibration_send_sockfd = @@ -951,10 +950,9 @@ void autocalibrate() if (ntohl(message.order) == AUTOCALIBRATION_ORDER_SEND) { -#ifdef DEBUG - fprintf(stderr, "I just was ordered to send an autocalibration" - " request...\n") ; -#endif // DEBUG + if (GET_VERBOSE()) + fprintf(stderr, "I was just ordered to send an" + " autocalibration request...\n") ; send_autocalibration_request() ; } else