[Client] Use timestamp_to_string()
Use owl_timestamp_to_string() instead of owl_timestamp_to_ms() to display the packet timestamp.
This commit is contained in:
parent
33f863e2e1
commit
8ae9e7915b
|
@ -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) ;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue