From 8ae9e7915b8f8e8d2cd0be891e728addc629dbda Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Tue, 15 Mar 2011 14:28:52 +0100 Subject: [PATCH] [Client] Use timestamp_to_string() Use owl_timestamp_to_string() instead of owl_timestamp_to_ms() to display the packet timestamp. --- infrastructure-centred/owlps-client/owlps-client.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/infrastructure-centred/owlps-client/owlps-client.c b/infrastructure-centred/owlps-client/owlps-client.c index b6ec09b..b126cd3 100644 --- a/infrastructure-centred/owlps-client/owlps-client.c +++ b/infrastructure-centred/owlps-client/owlps-client.c @@ -303,15 +303,15 @@ void make_packet() { uint_fast16_t offset ; // Index used to create the packet TIMESTAMP request_time ; - uint_fast64_t request_time_ms ; + char request_time_str[TIMESTAMP_STR_LEN] ; owl_timestamp_now(&request_time) ; - request_time_ms = owl_timestamp_to_ms(request_time) ; + owl_timestamp_to_string(request_time_str, request_time) ; request_time = owl_hton_timestamp(request_time) ; if (is_calibration_request) // Calibration packet { - printf("Calibration time: %"PRIu64"\n", request_time_ms) ; + printf("Preparing calibration request packet…\n") ; offset = 0 ; packet_size = @@ -336,12 +336,14 @@ void make_packet() else // Standard packet { - printf("Request time: %"PRIu64"\n", request_time_ms) ; + printf("Preparing request packet…\n") ; packet_size = sizeof(uint8_t) + sizeof(TIMESTAMP) ; packet = malloc(packet_size) ; memset(&packet[0], PACKET_TYPE_NORMAL, 1) ; // Packet type memcpy(&packet[1], &request_time, sizeof(request_time)) ; } + + printf("Packet timestamp: %s\n", request_time_str) ; }