STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fsw::streams::SensorFramePipeline Class Reference

UDP pipeline: DAQv2-Comms board packets → internal SensorBatch. More...

#include <SensorFramePipeline.hpp>

Collaboration diagram for fsw::streams::SensorFramePipeline:
[legend]

Classes

struct  LastHeartbeat
struct  LastLog
struct  EnvironmentalSample

Public Member Functions

 SensorFramePipeline (const std::string &bind_address, uint16_t bind_port)
 ~SensorFramePipeline ()=default
std::optional< daq_comms::protocol::SensorBatch > poll ()
const std::string & last_source_ip () const
bool is_ready () const
std::string last_error () const
ssize_t send_to (const std::string &dest_ip, uint16_t dest_port, const uint8_t *data, size_t size)
bool set_broadcast (bool enable)
std::optional< LastHeartbeat > get_last_heartbeat ()
std::optional< LastLog > get_last_log ()
std::optional< EnvironmentalSample > get_last_environmental ()

Private Attributes

std::unique_ptr< daq_comms::transport::UDPSocket > socket_
std::vector< uint8_t > receive_buffer_
std::string last_error_
std::string last_source_ip_
std::vector< uint8_t > last_heartbeat_buffer_
std::string last_heartbeat_source_ip_
std::vector< uint8_t > last_log_buffer_
std::string last_log_source_ip_
std::optional< EnvironmentalSample > last_environmental_

Static Private Attributes

static constexpr size_t RECEIVE_BUFFER_SIZE = 8192

Detailed Description

UDP pipeline: DAQv2-Comms board packets → internal SensorBatch.

Definition at line 19 of file SensorFramePipeline.hpp.

Constructor & Destructor Documentation

◆ SensorFramePipeline()

fsw::streams::SensorFramePipeline::SensorFramePipeline ( const std::string & bind_address,
uint16_t bind_port )
explicit

Definition at line 16 of file SensorFramePipeline.cpp.

References last_error_, receive_buffer_, RECEIVE_BUFFER_SIZE, and socket_.

◆ ~SensorFramePipeline()

fsw::streams::SensorFramePipeline::~SensorFramePipeline ( )
default

Member Function Documentation

◆ get_last_environmental()

std::optional< SensorFramePipeline::EnvironmentalSample > fsw::streams::SensorFramePipeline::get_last_environmental ( )

Definition at line 196 of file SensorFramePipeline.cpp.

References last_environmental_.

Referenced by main().

◆ get_last_heartbeat()

std::optional< SensorFramePipeline::LastHeartbeat > fsw::streams::SensorFramePipeline::get_last_heartbeat ( )

Definition at line 167 of file SensorFramePipeline.cpp.

References last_heartbeat_buffer_, and last_heartbeat_source_ip_.

Referenced by main().

◆ get_last_log()

std::optional< SensorFramePipeline::LastLog > fsw::streams::SensorFramePipeline::get_last_log ( )

Definition at line 179 of file SensorFramePipeline.cpp.

References last_log_buffer_, and last_log_source_ip_.

Referenced by main().

◆ is_ready()

bool fsw::streams::SensorFramePipeline::is_ready ( ) const

Definition at line 191 of file SensorFramePipeline.cpp.

References socket_.

Referenced by main().

◆ last_error()

std::string fsw::streams::SensorFramePipeline::last_error ( ) const

Definition at line 200 of file SensorFramePipeline.cpp.

References last_error_.

Referenced by main(), and poll().

◆ last_source_ip()

const std::string & fsw::streams::SensorFramePipeline::last_source_ip ( ) const
inline

Definition at line 26 of file SensorFramePipeline.hpp.

References last_source_ip_.

Referenced by main().

◆ poll()

◆ send_to()

ssize_t fsw::streams::SensorFramePipeline::send_to ( const std::string & dest_ip,
uint16_t dest_port,
const uint8_t * data,
size_t size )

Definition at line 160 of file SensorFramePipeline.cpp.

References socket_.

Referenced by main().

◆ set_broadcast()

bool fsw::streams::SensorFramePipeline::set_broadcast ( bool enable)

Definition at line 154 of file SensorFramePipeline.cpp.

References enable(), and socket_.

Referenced by main().

Member Data Documentation

◆ last_environmental_

std::optional<EnvironmentalSample> fsw::streams::SensorFramePipeline::last_environmental_
private

Definition at line 72 of file SensorFramePipeline.hpp.

Referenced by get_last_environmental(), and poll().

◆ last_error_

std::string fsw::streams::SensorFramePipeline::last_error_
private

Definition at line 64 of file SensorFramePipeline.hpp.

Referenced by last_error(), poll(), and SensorFramePipeline().

◆ last_heartbeat_buffer_

std::vector<uint8_t> fsw::streams::SensorFramePipeline::last_heartbeat_buffer_
private

Definition at line 67 of file SensorFramePipeline.hpp.

Referenced by get_last_heartbeat(), and poll().

◆ last_heartbeat_source_ip_

std::string fsw::streams::SensorFramePipeline::last_heartbeat_source_ip_
private

Definition at line 68 of file SensorFramePipeline.hpp.

Referenced by get_last_heartbeat(), and poll().

◆ last_log_buffer_

std::vector<uint8_t> fsw::streams::SensorFramePipeline::last_log_buffer_
private

Definition at line 70 of file SensorFramePipeline.hpp.

Referenced by get_last_log(), and poll().

◆ last_log_source_ip_

std::string fsw::streams::SensorFramePipeline::last_log_source_ip_
private

Definition at line 71 of file SensorFramePipeline.hpp.

Referenced by get_last_log(), and poll().

◆ last_source_ip_

std::string fsw::streams::SensorFramePipeline::last_source_ip_
private

Definition at line 65 of file SensorFramePipeline.hpp.

Referenced by last_source_ip(), and poll().

◆ receive_buffer_

std::vector<uint8_t> fsw::streams::SensorFramePipeline::receive_buffer_
private

Definition at line 63 of file SensorFramePipeline.hpp.

Referenced by poll(), and SensorFramePipeline().

◆ RECEIVE_BUFFER_SIZE

size_t fsw::streams::SensorFramePipeline::RECEIVE_BUFFER_SIZE = 8192
staticconstexprprivate

Definition at line 74 of file SensorFramePipeline.hpp.

Referenced by SensorFramePipeline().

◆ socket_

std::unique_ptr<daq_comms::transport::UDPSocket> fsw::streams::SensorFramePipeline::socket_
private

Definition at line 62 of file SensorFramePipeline.hpp.

Referenced by is_ready(), poll(), send_to(), SensorFramePipeline(), and set_broadcast().


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