diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-01-08 11:49:26 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-01-10 20:32:49 +0100 |
commit | 70c5ba0867945bb097f466262ce03470b690518f (patch) | |
tree | c7b14e7e5debdad25778d18559d42f5306289e67 /src/dabOutput | |
parent | 3bcda54518c4914c1b934d7d12b7219d1ee7d941 (diff) | |
download | dabmux-70c5ba0867945bb097f466262ce03470b690518f.tar.gz dabmux-70c5ba0867945bb097f466262ce03470b690518f.tar.bz2 dabmux-70c5ba0867945bb097f466262ce03470b690518f.zip |
Add TAI handling for EDI with TIST
Diffstat (limited to 'src/dabOutput')
-rw-r--r-- | src/dabOutput/edi/TagItems.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/dabOutput/edi/TagItems.h b/src/dabOutput/edi/TagItems.h index 355b6e6..dee857a 100644 --- a/src/dabOutput/edi/TagItems.h +++ b/src/dabOutput/edi/TagItems.h @@ -74,8 +74,43 @@ class TagDETI : public TagItem // ATST (optional) bool atstf; // presence of atst data + + /* UTCO: Offset (in seconds) between UTC and the Seconds value. The + * value is expressed as an unsigned 8-bit quantity. As of February + * 2009, the value shall be 2 and shall change as a result of each + * modification of the number of leap seconds, as proscribed by + * International Earth Rotation and Reference Systems Service (IERS). + * + * According to Annex F + * EDI = TAI - 32s (constant) + * EDI = UTC + UTCO + * we derive + * UTCO = TAI-UTC - 32 + * where the TAI-UTC offset is given by the USNO bulletin using + * the ClockTAI module. + */ uint8_t utco; + + void set_utco(int tai_utc_offset) { utco = tai_utc_offset - 32; } + + /* The number of SI seconds since 2000-01-01 T 00:00:00 UTC as an + * unsigned 32-bit quantity + */ uint32_t seconds; + + void set_seconds(struct timeval tv) + { + time_t posix_timestamp_1_jan_2000 = 946684800; + seconds = tv.tv_sec - posix_timestamp_1_jan_2000; + } + + + /* TSTA: Shall be the 24 least significant bits of the Time Stamp + * (TIST) field from the STI-D(LI) Frame. The full definition for the + * STI TIST can be found in annex B of EN 300 797 [4]. The most + * significant 8 bits of the TIST field of the incoming STI-D(LI) + * frame, if required, may be carried in the RFAD field. + */ uint32_t tsta; // the FIC (optional) |