RIT VEXU Core API
Loading...
Searching...
No Matches
VDP::PacketWriter Class Reference

#include <protocol.hpp>

Public Member Functions

 PacketWriter (Packet &scratch_space)
 
void clear ()
 
size_t size ()
 
void write_byte (uint8_t b)
 
void write_type (Type t)
 
void write_string (const std::string &str)
 
void write_channel_acknowledge (const Channel &chan)
 
void write_channel_broadcast (const Channel &chan)
 
void write_response (std::deque< Channel > &channels)
 
void write_data_message (const Channel &part)
 
void write_request ()
 
const Packet & get_packet () const
 
template<typename Number>
void write_number (const Number &num)
 

Detailed Description

Defines a PacketWriter, it writes packets

Constructor & Destructor Documentation

◆ PacketWriter()

VDP::PacketWriter::PacketWriter ( VDP::Packet & scratch)
explicit

creates a packet writer

Parameters
scratch_spacethe packet for the writer to write to

Member Function Documentation

◆ clear()

void VDP::PacketWriter::clear ( )

clears the packet the writer is writing to

◆ get_packet()

const Packet & VDP::PacketWriter::get_packet ( ) const
Returns
the packet the writer is writing to

◆ size()

size_t VDP::PacketWriter::size ( )
Returns
the size of the packet

◆ write_byte()

void VDP::PacketWriter::write_byte ( uint8_t b)

writes a byte to the end of the packet

Parameters
bthe byte to write

◆ write_channel_acknowledge()

void VDP::PacketWriter::write_channel_acknowledge ( const Channel & chan)

writes a broadcast acknowledgement of a channel to the packet

Parameters
chanthe channel to write the acknowledgement for

◆ write_channel_broadcast()

void VDP::PacketWriter::write_channel_broadcast ( const Channel & chan)

writes a broadcast of a channel schematic to the packet

Parameters
chanthe channel to write the schematic from

◆ write_data_message()

void VDP::PacketWriter::write_data_message ( const Channel & chan)

writes the data from a channel to the packet

Parameters
chanthe Channel to write the data from

◆ write_number()

template<typename Number>
void VDP::PacketWriter::write_number ( const Number & num)
inline

writes a number to the end of the packet

◆ write_request()

void VDP::PacketWriter::write_request ( )

writes a request for a channel schematic to the packets

Parameters
chanthe Channel to write the data from

writes a request for a channel schematic to the packet

Parameters
chanthe channel to request

◆ write_response()

void VDP::PacketWriter::write_response ( std::deque< Channel > & response_queue)

writes a response packet to the packets

Parameters
chanthe Channel to write the data from

writes a response packet to the brain

Parameters
response_queuethe queue of channels to respond with

◆ write_string()

void VDP::PacketWriter::write_string ( const std::string & str)

writes a string to the packet

Parameters
strthe string to write to the packet

◆ write_type()

void VDP::PacketWriter::write_type ( Type t)

writes a VDP type to the packet in the form of a byte

Parameters
tthe VDP type to write to the packet

The documentation for this class was generated from the following files: