gaps-online-software 0.10
online software for the TOF system for the GAPS experiment
Loading...
Searching...
No Matches
TofPacket Struct Reference

#include <tof_packet.h>

Public Member Functions

std::string to_string () const
 
template<HasFromByteStream T>
unpack ()
 

Static Public Member Functions

static TofPacket from_bytestream (const Vec< u8 > &bytestream, u64 &pos)
 

Public Attributes

u16 head = 0xAAAA
 
u16 tail = 0x5555
 
PacketType packet_type
 
u32 payload_size
 
Vec< u8 > payload
 

Static Public Attributes

static const u16 HEAD = 0xAAAA
 
static const u16 TAIL = 0x5555
 

Detailed Description

The most basic of all packets

A wrapper packet for an arbitrary bytestream

It looks like the following

HEAD : u16 = 0xAAAA TYPE : u8 = PacketType SIZE : u64 PAYLOAD : [u8;6-SIZE] TAIL : u16 = 0x5555 => The packet has a fixed size of 9 bytes => The packet has a size of 9 + PAYLOAD.size()

Member Function Documentation

◆ from_bytestream()

static TofPacket TofPacket::from_bytestream ( const Vec< u8 > &  bytestream,
u64 &  pos 
)
static

Transcode the bytestream into the respective TofPacket

◆ to_string()

std::string TofPacket::to_string ( ) const

A representative representation of the TofPacket very usefule for debugging

◆ unpack()

template<HasFromByteStream T>
T TofPacket::unpack ( )
inline

A generic unpacking method - unpack everything which is stored within the payload This requires that T has a from_bytestream method, which is enforced at compile time by the concept HasFromByteStream


The documentation for this struct was generated from the following file: