RIT VEXU Core API
Loading...
Searching...
No Matches
VDP::Channel< T > Class Template Reference

A channel of data to be sent to the debug board. More...

#include <protocol.h>

Public Member Functions

 Channel (T &data, ChannelID id)
 Constructs a channel of data to be sent to the debug board.
ChannelID get_id () const
 Gets the channel's id.
T & get_data ()
 Gets the data stored inside the channel.
bool apply_update (VDP::PacketSpan data_packet)
 Applies an update from a received packet of data to the data held by the channel.
VDP::Packet serialize (PacketType pac_type)
 Serializes the channel as a packet to be sent over a wire to the debug board.
std::string schema_to_string () const
 Gets the channel's schema as a string.
std::string data_to_string () const
 Gets the channel's data as a string.

Detailed Description

template<typename T>
requires IsField<std::remove_cvref_t<T>>::value
class VDP::Channel< T >

A channel of data to be sent to the debug board.

Constructor & Destructor Documentation

◆ Channel()

template<typename T>
VDP::Channel< T >::Channel ( T & data,
ChannelID id )
inlineexplicit

Constructs a channel of data to be sent to the debug board.

Parameters
dataa field of data to be sent through this channel
ida byte designating the channel

Member Function Documentation

◆ apply_update()

template<typename T>
bool VDP::Channel< T >::apply_update ( VDP::PacketSpan data_packet)
inline

Applies an update from a received packet of data to the data held by the channel.

Parameters
data_packetthe received packet of data
Returns
whether or not the update was successful

◆ serialize()

template<typename T>
VDP::Packet VDP::Channel< T >::serialize ( PacketType pac_type)
inline

Serializes the channel as a packet to be sent over a wire to the debug board.

Parameters
pac_typethe type of packet to create, schema or data

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