1#ifndef TOFPACKET_H_INCLUDED
2#define TOFPACKET_H_INCLUDED
7#include "tof_typedefs.h"
9static const u8 UNKNOWN = 0;
10static const u8 COMMAND = 10;
11static const u8 RBEVENT = 20;
12static const u8 TOFEVENT = 21;
13static const u8 RBWAVEFORM = 22;
14static const u8 TOFEVENTSUMMARY = 23;
15static const u8 HEARTBEAT = 40;
16static const u8 SCALAR = 50;
17static const u8 MT = 60;
18static const u8 RBHEADER = 70;
19static const u8 CPUMONIDATA = 80;
20static const u8 MTB_MONI = 90;
21static const u8 RB_MONI = 100;
22static const u8 PBMONIDATA = 101;
23static const u8 LTBMONIDATA = 102;
24static const u8 PAMONIDATA = 103;
25static const u8 RBEVENTPAYLOAD = 110;
26static const u8 RBEVENTMEMORYVIEW = 120;
27static const u8 RBCALIBRATION = 130;
32enum class PacketType : u8 {
39 HeartBeat = HEARTBEAT ,
49 RBEventPayload = RBEVENTPAYLOAD ,
50 RBEventMemoryView = RBEVENTMEMORYVIEW ,
57std::string packet_type_to_string(PacketType pt);
59std::ostream& operator<<(std::ostream& os,
const PacketType& pck);
64 { T::from_bytestream(stream, pos) } -> std::same_as<T>;
82 static const u16 HEAD = 0xAAAA;
83 static const u16 TAIL = 0x5555;
89 PacketType packet_type;
112 template <HasFromByteStream T>
115 return T::from_bytestream(payload, pos);
119std::ostream& operator<<(std::ostream& os,
const TofPacket& pck);
Ensures that <T> has a method ::from_bytestream.
Definition tof_packet.h:63
Definition monitoring.h:216
Definition monitoring.h:19
Definition monitoring.h:148
Definition monitoring.h:116
Definition calibration.h:33
Definition tof_packet.h:81
std::string to_string() const
T unpack()
Definition tof_packet.h:113
static TofPacket from_bytestream(const Vec< u8 > &bytestream, u64 &pos)