summaryrefslogtreecommitdiffstats
path: root/lib/edi/common.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-18 11:49:11 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-18 11:49:11 +0200
commit015427d9e74f34dc7d0f7fbad4ad1eaad6537cce (patch)
tree01ae9249194fbff234e32b59c07f7894aef16878 /lib/edi/common.cpp
parent9c2e691744f96ae7ace8b82385b080ee9d858906 (diff)
downloaddabmux-015427d9e74f34dc7d0f7fbad4ad1eaad6537cce.tar.gz
dabmux-015427d9e74f34dc7d0f7fbad4ad1eaad6537cce.tar.bz2
dabmux-015427d9e74f34dc7d0f7fbad4ad1eaad6537cce.zip
EDI in: add audio levels metadata and source version
Diffstat (limited to 'lib/edi/common.cpp')
-rw-r--r--lib/edi/common.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/edi/common.cpp b/lib/edi/common.cpp
index 4629b55..ac8ec0c 100644
--- a/lib/edi/common.cpp
+++ b/lib/edi/common.cpp
@@ -339,4 +339,17 @@ bool TagDispatcher::decode_tagpacket(const vector<uint8_t> &payload)
return success;
}
+odr_version_data parse_odr_version_data(const std::vector<uint8_t>& data)
+{
+ if (data.size() < sizeof(uint32_t)) {
+ return {};
+ }
+
+ const size_t versionstr_length = data.size() - sizeof(uint32_t);
+ string version(data.begin(), data.begin() + versionstr_length);
+ uint32_t uptime_s = read_32b(data.begin() + versionstr_length);
+
+ return {version, uptime_s};
+}
+
}