From 8e872490876591ba2668eac18896b9a0c71181c3 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Wed, 2 Mar 2011 17:42:11 +0100 Subject: [PATCH] [Aggregator] Print mobile MAC to the output file --- .../owlps-aggregator/owlps-aggregatord.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c b/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c index 2bd2633..e965293 100644 --- a/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c +++ b/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c @@ -389,7 +389,7 @@ void* monitor_couples() couple_info_list *couple_info_ptr ; struct timeval current_time ; FILE *fd = NULL ; - char *ap_mac_string ; + char *mac_string ; unsigned long sub ; // sub_date() result unsigned long aggregate_timeout = @@ -451,6 +451,14 @@ void* monitor_couples() fprintf(fd, "%llu;", timeval_to_ms(couple_ptr->request_time)) ; #endif // TIMESTAMP + + // Print mobile MAC address to the output file + mac_string = + mac_bytes_to_string(couple_ptr + ->mobile_mac_addr_bytes) ; + fprintf(fd, "%s;", mac_string) ; + free(mac_string) ; + // Print couple info to the output file fprintf(fd, "%0.2f;%0.2f;%0.2f;%hhd", couple_ptr->x_position, couple_ptr->y_position, @@ -483,12 +491,12 @@ void* monitor_couples() 0, (struct sockaddr *)&serv, serv_len) ; // Print AP info to the output file - ap_mac_string = + mac_string = mac_bytes_to_string(couple_info_ptr ->ap_mac_addr_bytes) ; - fprintf(fd, ";%s;%d", ap_mac_string, + fprintf(fd, ";%s;%d", mac_string, couple_info_ptr->antenna_signal_dbm - 0x100) ; - free(ap_mac_string) ; + free(mac_string) ; // Delete couple couple_info_ptr = couple_info_ptr->next ;