-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiso15118.cpp
42 lines (32 loc) · 1.24 KB
/
iso15118.cpp
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
40
41
42
#include <cbv2g/exi_v2gtp.h>
#include <iso15118/message/schedule_exchange.hpp>
#include <iso15118/message/variant.hpp>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <iso15118/io/stream_view.hpp>
uint8_t* readAllStdin(size_t& length) {
std::vector<uint8_t> buffer;
char temp;
// Read all input data from stdin
while (std::cin.get(temp)) {
buffer.push_back(static_cast<uint8_t>(temp));
}
// Allocate memory for the buffer and copy the data
length = buffer.size();
uint8_t* data = new uint8_t[length];
std::copy(buffer.begin(), buffer.end(), data);
return data;
}
/*
*
* g++ iso15118.cpp -I ./libiso15118/build/_deps/libcbv2g-src/include/ -I libiso15118/include/ libiso15118/build/src/iso15118/libiso15118.a ./libiso15118//build/_deps/libcbv2g-build/lib/cbv2g/libcbv2g_tp.a libiso15118/build/_deps/libcbv2g-build/lib/cbv2g/libcbv2g_iso20.a libiso15118/build/_deps/libcbv2g-build/lib/cbv2g/libcbv2g_exi_codec.a -fprofile-arcs -ftest-coverage -o test
*
*/
int main()
{
size_t len;
uint8_t* data = readAllStdin(len);
const iso15118::io::StreamInputView stream_view{data, len};
iso15118::message_20::Variant variant(iso15118::io::v2gtp::PayloadType::Part20Main, stream_view);
}