aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputs/Test.cpp
blob: 925f871513fb2c6a8a1b97ea6be91b9a94dc5b92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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;

}