changed serial reading from lowlevel to boost with hope for more stability, changed a lot of smart pointers to unique_ptr, added fmt for logging

This commit is contained in:
2019-01-06 14:57:27 +01:00
parent bc27278ffb
commit 58f44dc957
21 changed files with 281 additions and 173 deletions

31
datatypes.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef DATATYPES_H
#define DATATYPES_H
#include <fmt/format.h>
#include <inttypes.h>
struct TransStruct {
uint16_t time;
uint8_t id;
uint8_t update;
};
struct TransCheck {
char begin;
struct TransStruct data[6];
char end;
};
template <> struct fmt::formatter<TransStruct> {
template <typename ParseContext> constexpr auto parse(ParseContext & ctx) {
return ctx.begin();
}
template <typename FormatContext>
auto format(const TransStruct & t, FormatContext & ctx) {
return format_to(ctx.out(), "id {}; time {}; update {}", t.id, t.time,
t.update);
}
};
#endif // DATATYPES_H