aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputs/Test.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-22 16:11:43 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2013-12-24 18:09:27 +0100
commitb0183733ef4c6f08ef8c7b73155268e54ca3f152 (patch)
tree5aa855d5dc36badbf1b2268bef79db0257146853 /src/inputs/Test.cpp
parent7094945ef7ecb8a918dfe3b4619bdc6f239cbb50 (diff)
downloaddabmux-b0183733ef4c6f08ef8c7b73155268e54ca3f152.tar.gz
dabmux-b0183733ef4c6f08ef8c7b73155268e54ca3f152.tar.bz2
dabmux-b0183733ef4c6f08ef8c7b73155268e54ca3f152.zip
InputBuffered know how to split frames
Diffstat (limited to 'src/inputs/Test.cpp')
-rw-r--r--src/inputs/Test.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/inputs/Test.cpp b/src/inputs/Test.cpp
new file mode 100644
index 0000000..925f871
--- /dev/null
+++ b/src/inputs/Test.cpp
@@ -0,0 +1,39 @@
+#include <string>
+#include <iostream>
+#include <vector>
+#include "TcpLog.h"
+#include "Input.h"
+
+using namespace std;
+
+TcpLog etiLog;
+
+int main(int argc, char** argv)
+{
+ const int bufsize = 188;
+ const int num = 10;
+ const string fname = "/home/bram/dab/mmbtools-aux/fb.dab";
+
+ cout << "Hello" << endl;
+
+ InputDabplusFile input(fname, 1, 5*bufsize, 100);
+ //InputFile input(fname);
+
+ cout << "Open " << input.Open() << endl;
+
+ cout << "Opened " << input.GetName() << endl;
+
+ std::vector<uint8_t> buffer(bufsize);
+
+ for (int i = 0; i < num; i++) {
+ int rc = input.ReadFrame(&buffer.front(), bufsize);
+
+ cout << "ReadFrame " << dec << rc << endl;
+
+ for(std::vector<uint8_t>::iterator it = buffer.begin(); it != buffer.end(); ++it) {
+ cout << hex << (unsigned int)*it << ", ";
+ }
+ }
+ cout << endl;
+
+}