Files
Rennbahn/datatypes.h

32 lines
665 B
C++

#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