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

#include <registry-listener.hpp>

Public Member Functions

 RegistryListener (AbstractDevice *device)
 
void take_packet (const Packet &pac)
 Call this if you are a device who has a packet for the protocol to decode.
 
bool submit_response (PacketType type, ChannelID id, PartPtr data)
 Submits a channel to respond to the board with.
 
void install_broadcast_callback (CallbackFn on_broadcastf)
 
void install_data_callback (CallbackFn on_dataf)
 
bool send_data (ChannelID id, PartPtr data)
 

Detailed Description

template<typename MutexType>
class VDP::RegistryListener< MutexType >

defines a device registry for sending data or listening to data over a device

Constructor & Destructor Documentation

◆ RegistryListener()

template<typename MutexType>
VDP::RegistryListener< MutexType >::RegistryListener ( AbstractDevice * device)
inline

creates a device registry for sending data or listening to data over the device

Parameters
devicethe device to send data to
reg_typethe type of registry it is (Listener or Controller)

Member Function Documentation

◆ install_broadcast_callback()

template<typename MutexType>
void VDP::RegistryListener< MutexType >::install_broadcast_callback ( CallbackFn on_broadcastf)
inline

installs a callback to a function that is called when the registry broadcasts the data schematic

Parameters
on_broadcastfthe callback to run when the registry broadcasts the schematic

◆ install_data_callback()

template<typename MutexType>
void VDP::RegistryListener< MutexType >::install_data_callback ( CallbackFn on_dataf)
inline

installs a callback to a function that is called when the registry broadbasts data

Parameters
on_datafthe callback to run when the registry broadcasts data

◆ send_data()

template<typename MutexType>
bool VDP::RegistryListener< MutexType >::send_data ( ChannelID id,
PartPtr data )
inline

sets the data at the channel id to a Part Pointer and sends it to the device

Parameters
idThe id of the channel to hold the data
datathe Part Pointer for the channel to hold and send to the device

◆ submit_response()

template<typename MutexType>
bool VDP::RegistryListener< MutexType >::submit_response ( PacketType type,
ChannelID id,
PartPtr data )
inline

Submits a channel to respond to the board with.

Parameters
idthe channel id to respond with
Returns
if the channel was submitted successfully or not

◆ take_packet()

template<typename MutexType>
void VDP::RegistryListener< MutexType >::take_packet ( const Packet & pac)
inline

Call this if you are a device who has a packet for the protocol to decode.

Parameters
pacthe packet to take.

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