diff --git a/libowlps/libowlps.c b/libowlps/libowlps.c index b1f3ae5..5d3a239 100644 --- a/libowlps/libowlps.c +++ b/libowlps/libowlps.c @@ -91,20 +91,10 @@ uint_fast8_t owl_frequency_to_channel(uint_fast16_t channel) /* - * Set the TIMESTAMP 'now' at the current time (millisecond-precision). + * Sets the TIMESTAMP 'now' at the current time. + * Returns 0 in case of success non-zero otherwise. */ -void owl_timestamp_now(TIMESTAMP *now) -{ - if (! owl_timestamp_now_ns(now)) - owl_timestamp_round_to_ms(now) ; -} - - - -/* - * Set the TIMESTAMP 'now' at the current time (nanosecond-precision). - */ -int owl_timestamp_now_ns(TIMESTAMP *now) +int owl_timestamp_now(TIMESTAMP *now) { int ret ; struct timespec now_ts ; @@ -121,16 +111,6 @@ int owl_timestamp_now_ns(TIMESTAMP *now) -/* - * Lower the precision of 'now' to milliseconds. - */ -void owl_timestamp_round_to_ms(TIMESTAMP *now) -{ - now->tv_nsec = now->tv_nsec / 1000000u * 1000000u ; -} - - - /* * Returns a TIMESTAMP from a struct timespec. */ diff --git a/libowlps/owlps.h b/libowlps/owlps.h index c0944df..5404e2a 100644 --- a/libowlps/owlps.h +++ b/libowlps/owlps.h @@ -227,9 +227,7 @@ BOOL owl_mac_equals(uint8_t *mac1, uint8_t *mac2) ; uint_fast8_t owl_frequency_to_channel(uint_fast16_t channel) ; // Time -void owl_timestamp_now(TIMESTAMP *now) ; -int owl_timestamp_now_ns(TIMESTAMP *now) ; -void owl_timestamp_round_to_ms(TIMESTAMP *now) ; +int owl_timestamp_now(TIMESTAMP *now) ; TIMESTAMP owl_timespec_to_timestamp(const struct timespec d) ; TIMESTAMP owl_timeval_to_timestamp(const struct timeval d) ; uint64_t owl_timestamp_to_ms(TIMESTAMP date) ;