From a2a8ed04fcf61f73e776c7ee2cfc44fb1fc5dbe6 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 24 Jan 2018 09:43:22 +0100 Subject: Handle Soapy TX and RX timestamps for DPD --- src/TimestampDecoder.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/TimestampDecoder.h') diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h index 33d9992..6eedf9e 100644 --- a/src/TimestampDecoder.h +++ b/src/TimestampDecoder.h @@ -81,6 +81,12 @@ struct frame_timestamp return ns; } + void set_ns(long long int time_ns) { + timestamp_sec = time_ns / 1000000000ull; + const long long int subsecond = time_ns % 1000000000ull; + timestamp_pps = lrint(subsecond * 16384000.0); + } + void print(const char* t) const { fprintf(stderr, "%s \n", -- cgit v1.2.3