diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-03-31 14:31:32 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-03-31 14:31:32 +0200 |
commit | ae70341365e27d766c8530924209fc4826036aea (patch) | |
tree | b18247e0b96b45b6f74b66d0ab5b5d69bb63f143 /src/TimestampDecoder.cpp | |
parent | fe19871f8ee362f65d194b864eb989618b994e58 (diff) | |
download | dabmod-ae70341365e27d766c8530924209fc4826036aea.tar.gz dabmod-ae70341365e27d766c8530924209fc4826036aea.tar.bz2 dabmod-ae70341365e27d766c8530924209fc4826036aea.zip |
Add JSON output to RC
Diffstat (limited to 'src/TimestampDecoder.cpp')
-rw-r--r-- | src/TimestampDecoder.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/TimestampDecoder.cpp b/src/TimestampDecoder.cpp index 6e97af6..149cd50 100644 --- a/src/TimestampDecoder.cpp +++ b/src/TimestampDecoder.cpp @@ -2,7 +2,7 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2018 + Copyright (C) 2023 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -301,3 +301,22 @@ const std::string TimestampDecoder::get_parameter( return ss.str(); } +const RemoteControllable::map_t TimestampDecoder::get_all_values() const +{ + map_t map; + map["offset"] = timestamp_offset; + if (full_timestamp_received) { + map["timestamp"] = time_secs + ((double)time_pps / 16384000.0); + } + else { + map["timestamp"] = std::nullopt; + } + + if (full_timestamp_received) { + map["timestamp0"] = time_secs_of_frame0 + ((double)time_pps_of_frame0 / 16384000.0); + } + else { + map["timestamp0"] = std::nullopt; + } + return map; +} |