|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
UDP pipeline: DAQv2-Comms board packets → internal SensorBatch. More...
#include <SensorFramePipeline.hpp>
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 |
UDP pipeline: DAQv2-Comms board packets → internal SensorBatch.
Definition at line 19 of file SensorFramePipeline.hpp.
|
explicit |
Definition at line 16 of file SensorFramePipeline.cpp.
References last_error_, receive_buffer_, RECEIVE_BUFFER_SIZE, and socket_.
|
default |
| std::optional< SensorFramePipeline::EnvironmentalSample > fsw::streams::SensorFramePipeline::get_last_environmental | ( | ) |
Definition at line 196 of file SensorFramePipeline.cpp.
References last_environmental_.
Referenced by main().
| 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().
| 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().
| bool fsw::streams::SensorFramePipeline::is_ready | ( | ) | const |
| std::string fsw::streams::SensorFramePipeline::last_error | ( | ) | const |
Definition at line 200 of file SensorFramePipeline.cpp.
References last_error_.
|
inline |
Definition at line 26 of file SensorFramePipeline.hpp.
References last_source_ip_.
Referenced by main().
| std::optional< daq_comms::protocol::SensorBatch > fsw::streams::SensorFramePipeline::poll | ( | ) |
Definition at line 25 of file SensorFramePipeline.cpp.
References daq_comms::protocol::ParsedSelfTestPacket::adc_good, daq::BOARD_HEARTBEAT, daq_comms::protocol::RawPTSample::channel_id, chunk, chunks, DIABLO_COMMS_VERSION, daq::ENVIRONMENTAL_DATA, daq_comms::protocol::SensorBatch::frame_timestamp_ns, daq_comms::protocol::ParsedSelfTestPacket::is_valid, daq_comms::protocol::SensorBatch::is_valid, last_environmental_, last_error(), last_error_, last_heartbeat_buffer_, last_heartbeat_source_ip_, last_log_buffer_, last_log_source_ip_, last_source_ip_, daq::LOGS, daq_comms::protocol::ParsedSelfTestPacket::num_sensors, daq_comms::protocol::ParsedSelfTestPacket::packet_type, daq::parse_environmental_data_packet(), daq::parse_self_test_packet(), daq::parse_sensor_data_packet(), daq_comms::protocol::SensorBatch::pt_samples, r, daq_comms::protocol::RawPTSample::raw_adc_counts, receive_buffer_, daq_comms::protocol::ParsedSelfTestPacket::results, daq_comms::protocol::RawPTSample::sample_timestamp_ms, daq::SELF_TEST, daq_comms::protocol::SensorBatch::self_tests, daq::SENSOR_DATA, daq_comms::protocol::SensorBatch::sequence_id, socket_, daq_comms::protocol::RawPTSample::status_flags, daq_comms::protocol::ParsedSelfTestPacket::timestamp, and daq_comms::protocol::ParsedSelfTestPacket::version.
Referenced by main().
| ssize_t fsw::streams::SensorFramePipeline::send_to | ( | const std::string & | dest_ip, |
| uint16_t | dest_port, | ||
| const uint8_t * | data, | ||
| size_t | size ) |
| bool fsw::streams::SensorFramePipeline::set_broadcast | ( | bool | enable | ) |
Definition at line 154 of file SensorFramePipeline.cpp.
References enable(), and socket_.
Referenced by main().
|
private |
Definition at line 72 of file SensorFramePipeline.hpp.
Referenced by get_last_environmental(), and poll().
|
private |
Definition at line 64 of file SensorFramePipeline.hpp.
Referenced by last_error(), poll(), and SensorFramePipeline().
|
private |
Definition at line 67 of file SensorFramePipeline.hpp.
Referenced by get_last_heartbeat(), and poll().
|
private |
Definition at line 68 of file SensorFramePipeline.hpp.
Referenced by get_last_heartbeat(), and poll().
|
private |
Definition at line 70 of file SensorFramePipeline.hpp.
Referenced by get_last_log(), and poll().
|
private |
Definition at line 71 of file SensorFramePipeline.hpp.
Referenced by get_last_log(), and poll().
|
private |
Definition at line 65 of file SensorFramePipeline.hpp.
Referenced by last_source_ip(), and poll().
|
private |
Definition at line 63 of file SensorFramePipeline.hpp.
Referenced by poll(), and SensorFramePipeline().
|
staticconstexprprivate |
Definition at line 74 of file SensorFramePipeline.hpp.
Referenced by SensorFramePipeline().
|
private |
Definition at line 62 of file SensorFramePipeline.hpp.
Referenced by is_ready(), poll(), send_to(), SensorFramePipeline(), and set_broadcast().