aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputs/Test.cpp
diff options
context:
space:
mode:
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;
+
+}