aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edi
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-08-20 15:01:25 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-08-20 15:01:25 +0200
commit9b18142f07d9d87bd9eced148a245b1d37bda29a (patch)
treef58fac90e103b6a9406a1347cd5e13b865f6de0a /lib/edi
parent3986a7b40c0043ec33c2c2b7cf5c615c65599997 (diff)
downloaddabmux-9b18142f07d9d87bd9eced148a245b1d37bda29a.tar.gz
dabmux-9b18142f07d9d87bd9eced148a245b1d37bda29a.tar.bz2
dabmux-9b18142f07d9d87bd9eced148a245b1d37bda29a.zip
Update common: improve multicast input and incomplete timestamps
Diffstat (limited to 'lib/edi')
-rw-r--r--lib/edi/common.cpp6
-rw-r--r--lib/edi/common.hpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/edi/common.cpp b/lib/edi/common.cpp
index b314737..38eadf9 100644
--- a/lib/edi/common.cpp
+++ b/lib/edi/common.cpp
@@ -33,9 +33,9 @@ namespace EdiDecoder {
using namespace std;
-bool frame_timestamp_t::valid() const
+bool frame_timestamp_t::is_valid() const
{
- return tsta != 0xFFFFFF;
+ return tsta != 0xFFFFFF and seconds != 0;
}
string frame_timestamp_t::to_string() const
@@ -43,7 +43,7 @@ string frame_timestamp_t::to_string() const
const time_t seconds_in_unix_epoch = to_unix_epoch();
stringstream ss;
- if (valid()) {
+ if (is_valid()) {
ss << "Timestamp: ";
}
else {
diff --git a/lib/edi/common.hpp b/lib/edi/common.hpp
index f273ecf..fdd7424 100644
--- a/lib/edi/common.hpp
+++ b/lib/edi/common.hpp
@@ -39,7 +39,7 @@ struct frame_timestamp_t {
uint32_t utco = 0;
uint32_t tsta = 0xFFFFFF; // According to EN 300 797 Annex B
- bool valid() const;
+ bool is_valid() const;
std::string to_string() const;
std::time_t to_unix_epoch() const;
std::chrono::system_clock::time_point to_system_clock() const;