[Listener] Use timestamp_to_string()

Use owl_timestamp_to_string() instead of owl_timestamp_to_ms() to
display the timestamps.
This commit is contained in:
Matteo Cypriani 2011-03-15 16:16:26 +01:00
parent 8ae9e7915b
commit 0b5ebc524f
1 changed files with 20 additions and 12 deletions

View File

@ -844,33 +844,38 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
/* Display the packet details */
if (GET_DISPLAY_CAPTURED())
{
char *ap_mac_string =
char *ap_mac_str =
owl_mac_bytes_to_string(couple.ap_mac_addr_bytes) ;
char *mobile_mac_string =
char *mobile_mac_str =
owl_mac_bytes_to_string(couple.mobile_mac_addr_bytes) ;
char
request_time_str[TIMESTAMP_STR_LEN],
start_time_str[TIMESTAMP_STR_LEN] ;
owl_timestamp_to_string(request_time_str, couple.request_time) ;
owl_timestamp_to_string(start_time_str, couple.start_time) ;
printf("*** Couple to send ***\n"
"\tMAC AP: %s\n"
"\tMobile MAC: %s\n"
"\tSequence number (request time): %"PRIu64"\n"
"\tRequest arrival time on the AP: %"PRIu64"\n"
"\tSequence number (request time): %s\n"
"\tRequest arrival time on the AP: %s\n"
"\tSignal: %d dBm\n"
"\tPosition X: %f\n"
"\tPosition Y: %f\n"
"\tPosition Z: %f\n"
"\tDirection: %hhd\n"
,
ap_mac_string,
mobile_mac_string,
owl_timestamp_to_ms(couple.request_time),
owl_timestamp_to_ms(couple.start_time),
ap_mac_str,
mobile_mac_str,
request_time_str,
start_time_str,
couple.antenna_signal_dbm - 0x100,
couple.x_position,
couple.y_position,
couple.z_position,
couple.direction
) ;
free(ap_mac_string) ;
free(mobile_mac_string) ;
free(ap_mac_str) ;
free(mobile_mac_str) ;
}
/* Send couple to the aggregator */
@ -1061,8 +1066,11 @@ uint_fast16_t make_packet(uint8_t **packet)
owl_timestamp_now(&request_time) ;
if (GET_VERBOSE())
printf("Autocalibration time: %"PRIu64"\n",
owl_timestamp_to_ms(request_time)) ;
{
char request_time_str[TIMESTAMP_STR_LEN] ;
owl_timestamp_to_string(request_time_str, request_time) ;
printf("Autocalibration time: %s\n", request_time_str) ;
}
size = sizeof(char) + sizeof(TIMESTAMP) ;
pkt = malloc(size) ;