aboutsummaryrefslogtreecommitdiffstats
path: root/src/dabOutput/edi
diff options
context:
space:
mode:
Diffstat (limited to 'src/dabOutput/edi')
-rw-r--r--src/dabOutput/edi/TagItems.cpp8
-rw-r--r--src/dabOutput/edi/TagItems.h10
2 files changed, 10 insertions, 8 deletions
diff --git a/src/dabOutput/edi/TagItems.cpp b/src/dabOutput/edi/TagItems.cpp
index f3e8404..54e996b 100644
--- a/src/dabOutput/edi/TagItems.cpp
+++ b/src/dabOutput/edi/TagItems.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013,2014 Matthias P. Braendli
+ Copyright (C) 2016 Matthias P. Braendli
http://mpb.li
EDI output.
@@ -131,6 +131,12 @@ std::vector<uint8_t> TagDETI::Assemble()
return packet;
}
+void TagDETI::set_seconds(std::chrono::system_clock::time_point t)
+{
+ std::time_t posix_timestamp_1_jan_2000 = 946684800;
+ seconds = std::chrono::system_clock::to_time_t(t) - posix_timestamp_1_jan_2000;
+}
+
std::vector<uint8_t> TagESTn::Assemble()
{
diff --git a/src/dabOutput/edi/TagItems.h b/src/dabOutput/edi/TagItems.h
index 50d5e99..6a8470b 100644
--- a/src/dabOutput/edi/TagItems.h
+++ b/src/dabOutput/edi/TagItems.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013,2014 Matthias P. Braendli
+ Copyright (C) 2016 Matthias P. Braendli
http://mpb.li
EDI output.
@@ -30,6 +30,7 @@
#include "config.h"
#include "Eti.h"
#include <vector>
+#include <chrono>
#include <string>
#include <stdint.h>
@@ -98,12 +99,7 @@ class TagDETI : public TagItem
*/
uint32_t seconds;
- void set_seconds(struct timespec tv)
- {
- time_t posix_timestamp_1_jan_2000 = 946684800;
- seconds = tv.tv_sec - posix_timestamp_1_jan_2000;
- }
-
+ void set_seconds(std::chrono::system_clock::time_point t);
/* 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