1#ifndef TOFPACKET_H_INCLUDED
2#define TOFPACKET_H_INCLUDED
7#include "result/result.h"
8#include "tof_typedefs.h"
13static const u8 UNKNOWN = 0;
14static const u8 COMMAND = 10;
15static const u8 RBEVENT = 20;
16static const u8 TOFEVENT = 21;
17static const u8 RBWAVEFORM = 22;
18static const u8 TOFEVENTSUMMARY = 23;
19static const u8 HEARTBEAT = 40;
20static const u8 SCALAR = 50;
21static const u8 MT = 60;
22static const u8 RBHEADER = 70;
23static const u8 CPUMONIDATA = 80;
24static const u8 MTB_MONI = 90;
25static const u8 RB_MONI = 100;
26static const u8 PBMONIDATA = 101;
27static const u8 LTBMONIDATA = 102;
28static const u8 PAMONIDATA = 103;
29static const u8 RBEVENTPAYLOAD = 110;
30static const u8 RBEVENTMEMORYVIEW = 120;
31static const u8 RBCALIBRATION = 130;
36enum class PacketType : u8 {
43 HeartBeat = HEARTBEAT ,
53 RBEventPayload = RBEVENTPAYLOAD ,
54 RBEventMemoryView = RBEVENTMEMORYVIEW ,
59auto packet_type_to_string(PacketType pt) -> std::string;
61std::ostream& operator<<(std::ostream& os,
const PacketType& pck);
66 { T::from_bytestream(stream, pos) } -> std::same_as<T>;
84 static constexpr u16 HEAD = 0xAAAA;
85 static constexpr u16 TAIL = 0x5555;
91 PacketType packet_type;
103 -> r::Result<TofPacket, Gaps::IOError>;
117 return T::from_bytestream(payload, pos);
121std::ostream& operator<<(std::ostream& os,
const TofPacket& pck);
Ensures that <T> has a method ::from_bytestream.
Definition tof_packet.h:65
Definition monitoring.h:210
Definition monitoring.h:19
Definition monitoring.h:148
Definition monitoring.h:116
Definition calibration.h:34
Definition tof_packet.h:83
static auto from_bytestream(const Vec< u8 > &bytestream, u64 &pos) -> r::Result< TofPacket, Gaps::IOError >
T unpack()
Definition tof_packet.h:115
auto to_string() const -> std::string