diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-09-14 00:08:53 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-09-14 00:08:53 +0200 |
commit | 685095418bc8fd27dcd0b1d73ad1741114aeda6a (patch) | |
tree | 5d959800a98b294cdc08278c8eaf181730190e07 /src/TimestampDecoder.h | |
parent | 0b7bc4a405ea4d6f24fade9420e9919420c64d8e (diff) | |
download | dabmod-685095418bc8fd27dcd0b1d73ad1741114aeda6a.tar.gz dabmod-685095418bc8fd27dcd0b1d73ad1741114aeda6a.tar.bz2 dabmod-685095418bc8fd27dcd0b1d73ad1741114aeda6a.zip |
SFN: carry FCT along with timestamps
This is the first step to fix issue #6.
The goal is to enable the OutputUHD to check
for FCT consistency. Once it can do that,
it will also be able to reset the UHD streamer if
necessary.
Diffstat (limited to 'src/TimestampDecoder.h')
-rw-r--r-- | src/TimestampDecoder.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h index 52290ac..0c393e4 100644 --- a/src/TimestampDecoder.h +++ b/src/TimestampDecoder.h @@ -2,8 +2,10 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Includes modifications for which no copyright is claimed - 2012, Matthias P. Braendli, matthias.braendli@mpb.li + Copyright (C) 2014 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://opendigitalradio.org */ /* This file is part of ODR-DabMod. @@ -52,6 +54,9 @@ struct modulator_offset_config struct frame_timestamp { + // Which frame count does this timestamp apply to + uint32_t fct; + uint32_t timestamp_sec; double timestamp_pps_offset; bool timestamp_valid; @@ -64,6 +69,7 @@ struct frame_timestamp this->timestamp_pps_offset = rhs.timestamp_pps_offset; this->timestamp_valid = rhs.timestamp_valid; this->timestamp_refresh = rhs.timestamp_refresh; + this->fct = rhs.fct; } return *this; @@ -104,7 +110,7 @@ struct frame_timestamp /* This module decodes MNSC time information */ class TimestampDecoder { - public: + public: TimestampDecoder( struct modulator_offset_config& config, Logger& logger): @@ -113,6 +119,7 @@ class TimestampDecoder inhibit_second_update = 0; time_pps = 0.0; time_secs = 0; + latestFCT = 0; enableDecode = false; full_timestamp_received_mnsc = false; gmtime_r(0, &temp_time); @@ -129,7 +136,11 @@ class TimestampDecoder void calculateTimestamp(struct frame_timestamp& ts); /* Update timestamp data from data in ETI */ - void updateTimestampEti(int framephase, uint16_t mnsc, double pps); + void updateTimestampEti( + int framephase, + uint16_t mnsc, + double pps, + uint32_t fct); /* Update the modulator timestamp offset according to the modconf */ @@ -147,7 +158,7 @@ class TimestampDecoder * the timestamp */ void updateTimestampPPS(double pps); - + /* Update the timestamp when a full set of MNSC data is * known. This function can be called at most every four * frames when the data is transferred using the MNSC. @@ -156,6 +167,7 @@ class TimestampDecoder struct tm temp_time; uint32_t time_secs; + uint32_t latestFCT; double time_pps; double timestamp_offset; int inhibit_second_update; |