summaryrefslogtreecommitdiffstats
path: root/src/InputReader.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-25 23:53:51 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-25 23:53:51 +0100
commitfd6d695275f88e83ebba6fa39afc044e329a690f (patch)
tree38ac7b49407970cb3c0b2b66972653a37d0d1fd5 /src/InputReader.h
parenteaf1c41bde2b58446697360af454266c4dc594a4 (diff)
downloaddabmod-fd6d695275f88e83ebba6fa39afc044e329a690f.tar.gz
dabmod-fd6d695275f88e83ebba6fa39afc044e329a690f.tar.bz2
dabmod-fd6d695275f88e83ebba6fa39afc044e329a690f.zip
Add first version of EDI input
Diffstat (limited to 'src/InputReader.h')
-rw-r--r--src/InputReader.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/InputReader.h b/src/InputReader.h
index 4d0792b..fddfccf 100644
--- a/src/InputReader.h
+++ b/src/InputReader.h
@@ -25,8 +25,7 @@
along with ODR-DabMod. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef INPUTREADER_H
-#define INPUTREADER_H
+#pragma once
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -41,6 +40,8 @@
#endif
#include "porting.h"
#include "Log.h"
+#include "lib/edi/ETIDecoder.hpp"
+#include "lib/UdpSocket.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
@@ -244,6 +245,28 @@ class InputZeroMQReader : public InputReader
struct InputZeroMQThreadData workerdata_;
};
-#endif
+class InputEdiReader : public InputReader
+{
+public:
+ InputEdiReader();
+
+ int Open(const std::string& uri);
+
+ int GetNextFrame(void* buffer);
+
+ void PrintInfo(void);
+
+private:
+ void rx_packet(void);
+
+ std::vector<uint8_t> getEtiFrame(void);
+
+ EdiDecoder::ETIWriter m_writer;
+ EdiDecoder::ETIDecoder m_decoder;
+
+ int m_port;
+ UdpSocket m_sock;
+};
+
#endif