|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| struct | SensorDataChunkCollection |
| Represents a single data chunk with timestamp and sensor datapoints. More... | |
| struct | SensorConfigData |
| High-level representation of a parsed Sensor Config payload. More... | |
Enumerations | |
| enum class | PacketType : uint8_t { BOARD_HEARTBEAT = 1 , SERVER_HEARTBEAT = 2 , SENSOR_DATA = 3 , ACTUATOR_COMMAND = 4 , SENSOR_CONFIG = 5 , ACTUATOR_CONFIG = 6 , ABORT = 7 , ABORT_DONE = 8 , CLEAR_ABORT = 9 , PWM_ACTUATOR_COMMAND = 10 , NO_CONNECTION_ABORT = 11 , SELF_TEST = 12 , ENVIRONMENTAL_DATA = 13 , STACKLIGHT_COMMAND = 14 , LOGS = 15 } |
| Defines the type of data contained in a packet. More... | |
| enum class | BoardState : uint8_t { SETUP = 1 , ACTIVE = 2 , CONNECTION_LOSS_DETECTED = 3 , NO_CONNECTION_ABORT = 4 , NO_CONN_ABORT_FOLLOWER = 5 , PT_ABORT = 6 , NO_PT_ABORT = 7 , ABORT_FINISHED = 8 , STANDALONE_ABORT = 9 , SELF_TEST = 10 } |
| Defines the operational state of a board. More... | |
| enum class | EngineState : uint8_t { SAFE = 0 , PRESSURIZING = 1 , LOX_FILL = 2 , FIRING = 3 , POST_FIRE = 4 } |
| Defines the overall state of the engine system. More... | |
Functions | |
| struct | __attribute__ ((packed)) PacketHeader |
| The standard 6-byte header preceding every packet. | |
| size_t | create_board_heartbeat_packet (const BoardHeartbeatPacket &data, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete Board Heartbeat packet in the provided buffer. | |
| size_t | create_sensor_data_packet (const std::vector< SensorDataChunkCollection > &chunks, const uint8_t num_sensors, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete Sensor Data packet in the provided buffer. | |
| size_t | create_abort_done_packet (uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a simple Abort Done packet. | |
| size_t | create_actuator_command_packet (const std::vector< ActuatorCommand > &commands, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete Actuator Command packet in the provided buffer. | |
| size_t | create_self_test_packet (uint8_t adc_good, const std::vector< SelfTestResult > &results, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete Self Test packet in the provided buffer. | |
| size_t | create_environmental_data_packet (float temperature_c, uint32_t pressure_pa, float humidity_rh, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete Environmental Data packet in the provided buffer. | |
| size_t | create_stacklight_command_packet (const StacklightCommandPacket &data, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete Stacklight Command packet in the provided buffer. | |
| bool | parse_board_heartbeat_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, BoardHeartbeatPacket &data_out) |
| Parses a Board Heartbeat packet from buffer. | |
| bool | parse_server_heartbeat_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, ServerHeartbeatPacket &data_out) |
| Parses a Server Heartbeat packet from buffer. | |
| bool | parse_environmental_data_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, EnvironmentalDataPacket &data_out) |
| Parses an Environmental Data packet from buffer. | |
| bool | parse_stacklight_command_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, StacklightCommandPacket &data_out) |
| Parses a Stacklight Command packet from buffer. | |
| bool | parse_sensor_data_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, std::vector< SensorDataChunkCollection > &chunks_out) |
| Parses a Sensor Data packet from buffer into chunk collections. | |
| bool | parse_abort_done_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out) |
| Parses an Abort Done packet from buffer. | |
| bool | parse_actuator_command_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, std::vector< ActuatorCommand > &commands_out) |
| Parses an Actuator Command packet from buffer. | |
| bool | parse_self_test_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, uint8_t &adc_good_out, std::vector< SelfTestResult > &results_out) |
| Parses a Self Test packet from buffer. | |
| size_t | create_pwm_actuator_packet (const std::vector< PWMActuatorCommand > &commands, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete PWM Actuator Command packet in the provided buffer. | |
| bool | parse_pwm_actuator_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, std::vector< PWMActuatorCommand > &commands_out) |
| Parses a PWM Actuator Command packet from buffer. | |
| size_t | create_sensor_config_packet (const std::vector< uint8_t > &sensor_ids, uint8_t reference_voltage, bool necessary_for_abort, uint32_t controller_ip, uint8_t enable_serial_printing, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete Sensor Config packet in the provided buffer. | |
| bool | parse_sensor_config_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, std::vector< uint8_t > &sensor_ids_out, uint8_t &reference_voltage_out, bool &necessary_for_abort_out, uint32_t &controller_ip_out, uint8_t &enable_serial_printing_out) |
| Parses a Sensor Config packet from buffer. | |
| size_t | create_actuator_config_packet (uint8_t is_abort_controller, const std::vector< AbortActuatorLocation > &abort_actuators, const std::vector< AbortPTLocation > &abort_pts, uint8_t enable_serial_printing, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a complete Actuator Config packet in the provided buffer. | |
| bool | parse_actuator_config_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, uint8_t &is_abort_controller_out, std::vector< AbortActuatorLocation > &abort_actuators_out, std::vector< AbortPTLocation > &abort_pts_out, uint8_t &enable_serial_printing_out) |
| Parses an Actuator Config packet from buffer. | |
| size_t | create_log_packet (uint8_t flags, const uint8_t *text, uint16_t text_len, uint32_t timestamp_ms, uint8_t *buffer, size_t buffer_size) |
| Creates a LOGS packet (type 15): buffered board log text for the server. | |
| bool | parse_log_packet (const uint8_t *buffer, size_t buffer_size, PacketHeader &header_out, uint8_t &flags_out, const uint8_t *&text_out, uint16_t &text_len_out) |
| Parses a LOGS packet (type 15) from buffer. | |
|
strong |
Defines the operational state of a board.
| Enumerator | |
|---|---|
| SETUP | |
| ACTIVE | |
| CONNECTION_LOSS_DETECTED | |
| NO_CONNECTION_ABORT | |
| NO_CONN_ABORT_FOLLOWER | |
| PT_ABORT | |
| NO_PT_ABORT | |
| ABORT_FINISHED | |
| STANDALONE_ABORT | |
| SELF_TEST | |
Definition at line 31 of file DiabloEnums.h.
|
strong |
Defines the overall state of the engine system.
This is communicated from the server to the boards.
| Enumerator | |
|---|---|
| SAFE | |
| PRESSURIZING | |
| LOX_FILL | |
| FIRING | |
| POST_FIRE | |
Definition at line 48 of file DiabloEnums.h.
|
strong |
Defines the type of data contained in a packet.
Definition at line 10 of file DiabloEnums.h.
| struct daq::__attribute__ | ( | (packed) | ) |
The standard 6-byte header preceding every packet.
Body of a stacklight command packet (after PacketHeader).
Body of an Environmental Data packet (after PacketHeader).
Represents a self test result for a single sensor.
Body of a Self Test packet.
Defines the location of a pressure transducer needed for an abort sequence, and its pressure threshold as an ADC code.
Single byte count of abort PT entries; appears after N actuator blocks.
Defines one abort actuator: location (IP), ID, vent state, and abort state.
Fixed-size header of an Actuator Config packet for abort configuration.
Represents a PWM command for a single actuator.
Body of a PWM Actuator Command packet.
Represents a command for a single actuator.
Body of an Actuator Command packet.
Fixed-size header of a Sensor Config packet.
Represents a single sensor reading.
Chunk of a Sensor Data packet.
Body of a Sensor Data packet.
Body of a Server Heartbeat packet.
Body of a Board Heartbeat packet.
Sent from a board to the server.
Sent from the server to all boards.
Contains the fixed-size fields.
Used in the SensorDataPacket.
Full packet layout (after standard PacketHeader):
Full packet layout (after standard PacketHeader):
7 bytes on wire: 4B IP + 1B actuator_id + 1B vent_state + 1B abort_state.
9 bytes on wire: 4B IP + 1B sensor_id + 4B pressure_threshold_adc.
On-wire layout (after PacketHeader): adc_good (1 byte) – 1 if TDAC self-test passed, 0 if failed num_sensors (1 byte) – number of SelfTestResult entries that follow N x SelfTestResult
Temperature in degrees Celsius, absolute pressure in Pa, relative humidity in RH.
Order: red, yellow, green, buzzer. Each byte is 1 = on, 0 = off.
Definition at line 1 of file DiabloPackets.h.
References __attribute__(), and board_id.
Referenced by __attribute__().
| size_t daq::create_abort_done_packet | ( | uint32_t | timestamp_ms, |
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a simple Abort Done packet.
This packet is sent from a board to the server to acknowledge that it has successfully completed its abort sequence. It has no data payload.
| timestamp_ms | Value for PacketHeader.timestamp. |
| buffer | The output buffer to write the final packet into. |
| buffer_size | The total size of the output buffer. |
Definition at line 93 of file DiabloPacketUtils.cpp.
References ABORT_DONE.
Referenced by test_abort_done_buffer_too_small(), and test_abort_done_roundtrip().
| size_t daq::create_actuator_command_packet | ( | const std::vector< ActuatorCommand > & | commands, |
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete Actuator Command packet in the provided buffer.
Packet layout: PacketHeader + ActuatorCommandPacket + N ActuatorCommand.
| commands | The list of actuator commands to serialize. |
| timestamp_ms | Value for PacketHeader.timestamp. |
| buffer | The output buffer to write the packet into. |
| buffer_size | The size of the provided buffer. |
Definition at line 115 of file DiabloPacketUtils.cpp.
References ACTUATOR_COMMAND, commands, DIABLO_COMMS_VERSION, and ptr.
Referenced by applyAbortToAllActuators(), applyVentToAllActuators(), fsw::control::PressureStateMachine::sendActuatorCommandUDP(), sequencer::ActuatorCommander::sendBatch(), test_actuator_command_empty_list(), and test_actuator_command_roundtrip().
| size_t daq::create_actuator_config_packet | ( | uint8_t | is_abort_controller, |
| const std::vector< AbortActuatorLocation > & | abort_actuators, | ||
| const std::vector< AbortPTLocation > & | abort_pts, | ||
| uint8_t | enable_serial_printing, | ||
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete Actuator Config packet in the provided buffer.
Packet layout: standard PacketHeader (ACTUATOR_CONFIG, version, timestamp), then config body: is_abort_controller (1B), N (1B), N x AbortActuatorLocation (7B each), then X (1B), X x AbortPTLocation (9B each), then enable_serial_printing (1B).
| is_abort_controller | 1 if this board is the abort controller, 0 otherwise. |
| abort_actuators | List of abort actuator entries (N entries, 7 bytes each). |
| abort_pts | List of abort PT entries (X entries, 9 bytes each). |
| enable_serial_printing | 1 to enable serial printing, 0 to disable. |
| timestamp_ms | Value for PacketHeader.timestamp. |
| buffer | The output buffer to write the packet into. |
| buffer_size | The size of the provided buffer. |
Definition at line 648 of file DiabloPacketUtils.cpp.
References ACTUATOR_CONFIG, config, DIABLO_COMMS_VERSION, is_abort_controller, MAX_ABORT_ACTUATORS, MAX_ABORT_PTS, and ptr.
Referenced by test_actuator_config_no_pts(), and test_actuator_config_roundtrip().
| size_t daq::create_board_heartbeat_packet | ( | const BoardHeartbeatPacket & | data, |
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete Board Heartbeat packet in the provided buffer.
This is a fixed-size packet sent periodically by a board to the server to indicate it is online and operational.
| data | The heartbeat data to encode (firmware SHA-256 hash, board ID, state, etc.). |
| timestamp_ms | Value for PacketHeader.timestamp (e.g. Arduino millis() on firmware). |
| buffer | The output buffer to write the final packet into. |
| buffer_size | The total size of the output buffer, used for safety checks. |
Definition at line 13 of file DiabloPacketUtils.cpp.
References BOARD_HEARTBEAT, and DIABLO_COMMS_VERSION.
Referenced by loop(), sendBoardHeartbeat(), sendBoardHeartbeat(), sendBoardHeartbeat(), SensorHotfire::sendBoardHeartbeat(), sendBoardHeartbeatTo(), sendHeartbeat(), sendHeartbeatPacket(), test_actuator_heartbeat_board_id_preserved(), test_actuator_heartbeat_state_mapping_table(), test_board_heartbeat_buffer_too_small(), test_board_heartbeat_parse_wrong_type(), test_board_heartbeat_roundtrip(), test_log_packet_parse_wrong_type(), and test_sensor_heartbeat_state_mapping_table().
| size_t daq::create_environmental_data_packet | ( | float | temperature_c, |
| uint32_t | pressure_pa, | ||
| float | humidity_rh, | ||
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete Environmental Data packet in the provided buffer.
Packet layout: PacketHeader + EnvironmentalDataPacket (temperature float °C, pressure uint32 Pa, humidity float RH).
Definition at line 201 of file DiabloPacketUtils.cpp.
References DIABLO_COMMS_VERSION, ENVIRONMENTAL_DATA, and ptr.
Referenced by loop().
| size_t daq::create_log_packet | ( | uint8_t | flags, |
| const uint8_t * | text, | ||
| uint16_t | text_len, | ||
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a LOGS packet (type 15): buffered board log text for the server.
Layout: PacketHeader (LOGS) + flags (1B) + text_len (2B, uint16 LE) + text bytes. The board is identified server-side by UDP source IP (static 192.168.2.<board_id>), so no board_id field. text is newline-delimited log lines blobbed together.
| flags | bit0 = TRUNCATED (some lines dropped on buffer overflow); rest reserved. |
| text | Log text bytes (ASCII, ' '-delimited). |
| text_len | Number of text bytes. |
| timestamp_ms | Value for PacketHeader.timestamp. |
| buffer | Output buffer. |
| buffer_size | Size of the output buffer. |
Definition at line 780 of file DiabloPacketUtils.cpp.
References DIABLO_COMMS_VERSION, LOGS, and ptr.
Referenced by flushLogs(), SensorHotfire::flushLogs(), test_log_packet_buffer_too_small(), test_log_packet_layout(), test_log_packet_parse_truncated(), and test_log_packet_roundtrip().
| size_t daq::create_pwm_actuator_packet | ( | const std::vector< PWMActuatorCommand > & | commands, |
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete PWM Actuator Command packet in the provided buffer.
Packet layout: PacketHeader + PWMActuatorCommandPacket + N PWMActuatorCommand.
| commands | The list of PWM actuator commands to serialize. |
| timestamp_ms | Value for PacketHeader.timestamp. |
| buffer | The output buffer to write the packet into. |
| buffer_size | The size of the provided buffer. |
Definition at line 447 of file DiabloPacketUtils.cpp.
References commands, DIABLO_COMMS_VERSION, ptr, and PWM_ACTUATOR_COMMAND.
Referenced by test_pwm_actuator_roundtrip().
| size_t daq::create_self_test_packet | ( | uint8_t | adc_good, |
| const std::vector< SelfTestResult > & | results, | ||
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete Self Test packet in the provided buffer.
Packet layout: PacketHeader + SelfTestPacket (adc_good + num_sensors) + N SelfTestResult.
| adc_good | 1 if the TDAC self-test passed (ADC is good), 0 if it failed. |
| results | The list of per-sensor self-test results to serialize. |
| timestamp_ms | Value for PacketHeader.timestamp. |
| buffer | The output buffer to write the packet into. |
| buffer_size | The size of the provided buffer. |
Definition at line 157 of file DiabloPacketUtils.cpp.
References DIABLO_COMMS_VERSION, ptr, and SELF_TEST.
Referenced by SensorHotfire::loop(), runSelfTest(), test_self_test_adc_bad(), and test_self_test_roundtrip().
| size_t daq::create_sensor_config_packet | ( | const std::vector< uint8_t > & | sensor_ids, |
| uint8_t | reference_voltage, | ||
| bool | necessary_for_abort, | ||
| uint32_t | controller_ip, | ||
| uint8_t | enable_serial_printing, | ||
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete Sensor Config packet in the provided buffer.
Packet layout: PacketHeader + num_sensors (1B) + N sensor_ids (1B each) + reference_voltage (1B) + necessary_for_abort (1B) + [controller_ip (4B) if necessary_for_abort] + enable_serial_printing (1B).
| sensor_ids | List of sensor IDs to include in the config. |
| reference_voltage | ADC reference voltage selection. |
| necessary_for_abort | Whether this board's sensors are needed for abort. |
| controller_ip | IP of the abort controller (only written when necessary_for_abort is true). |
| enable_serial_printing | 1 to enable serial printing, 0 to disable. |
| timestamp_ms | Value for PacketHeader.timestamp. |
| buffer | The output buffer to write the packet into. |
| buffer_size | The size of the provided buffer. |
Definition at line 519 of file DiabloPacketUtils.cpp.
References DIABLO_COMMS_VERSION, ptr, and SENSOR_CONFIG.
Referenced by fsw::config::SensorAssignmentManager::generate_board_config_packet(), test_sensor_config_empty_sensors(), test_sensor_config_roundtrip_with_abort(), test_sensor_config_roundtrip_without_abort(), test_sensor_process_sensor_config_packet(), and test_sensor_process_sensor_config_with_abort().
| size_t daq::create_sensor_data_packet | ( | const std::vector< SensorDataChunkCollection > & | chunks, |
| const uint8_t | num_sensors, | ||
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete Sensor Data packet in the provided buffer.
This is a variable-size packet containing readings from one or more sensor data chunks. It consists of a header, a fixed-size body specifying the number of chunks and sensors, followed by the actual sensor data chunks and their datapoints.
| chunks | A vector of SensorDataChunkCollection structs containing the sensor data. |
| num_sensors | The number of sensors that are included in the packet |
| timestamp_ms | Value for PacketHeader.timestamp. |
| buffer | The output buffer to write the final packet into. |
| buffer_size | The total size of the output buffer. |
Definition at line 41 of file DiabloPacketUtils.cpp.
References chunks, DIABLO_COMMS_VERSION, ptr, and SENSOR_DATA.
Referenced by loop(), readCurrentSensePinsAndSend(), readCurrentSensePinsAndSend(), send_chunks_to_impl(), sendDataChunks(), sendPositions(), sendReplyTo(), sendSensorDataPacket(), sendSensorDataPacket(), sendSensorDataPacketTo(), sendSensorPacket(), test_sensor_data_buffer_too_small(), and test_sensor_data_roundtrip().
| size_t daq::create_stacklight_command_packet | ( | const StacklightCommandPacket & | data, |
| uint32_t | timestamp_ms, | ||
| uint8_t * | buffer, | ||
| size_t | buffer_size ) |
Creates a complete Stacklight Command packet in the provided buffer.
Packet layout: PacketHeader + StacklightCommandPacket (red, yellow, green, buzzer; 1 = on).
Definition at line 231 of file DiabloPacketUtils.cpp.
References DIABLO_COMMS_VERSION, ptr, and STACKLIGHT_COMMAND.
Referenced by main().
| bool daq::parse_abort_done_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out ) |
Parses an Abort Done packet from buffer.
Definition at line 372 of file DiabloPacketUtils.cpp.
References ABORT_DONE.
Referenced by test_abort_done_roundtrip().
| bool daq::parse_actuator_command_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| std::vector< ActuatorCommand > & | commands_out ) |
Parses an Actuator Command packet from buffer.
Definition at line 384 of file DiabloPacketUtils.cpp.
References ACTUATOR_COMMAND, and ptr.
Referenced by loop(), main(), processIncomingPacket(), processIncomingPacket(), daqtest::BoardListener::run(), test_actuator_command_roundtrip(), and test_parse_null_buffer().
| bool daq::parse_actuator_config_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| uint8_t & | is_abort_controller_out, | ||
| std::vector< AbortActuatorLocation > & | abort_actuators_out, | ||
| std::vector< AbortPTLocation > & | abort_pts_out, | ||
| uint8_t & | enable_serial_printing_out ) |
Parses an Actuator Config packet from buffer.
Reads standard PacketHeader (must be ACTUATOR_CONFIG), then config body into outputs.
Definition at line 710 of file DiabloPacketUtils.cpp.
References ACTUATOR_CONFIG, config, MAX_ABORT_ACTUATORS, MAX_ABORT_PTS, and ptr.
Referenced by processIncomingPacket(), test_actuator_config_no_pts(), and test_actuator_config_roundtrip().
| bool daq::parse_board_heartbeat_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| BoardHeartbeatPacket & | data_out ) |
Parses a Board Heartbeat packet from buffer.
Definition at line 254 of file DiabloPacketUtils.cpp.
References BOARD_HEARTBEAT.
Referenced by decodeAndPrintPacket(), main(), fsw::config::BoardDiscovery::process_board_announcement(), test_actuator_heartbeat_board_id_preserved(), test_actuator_heartbeat_state_mapping_table(), test_board_heartbeat_parse_wrong_type(), test_board_heartbeat_roundtrip(), test_parse_null_buffer(), and test_sensor_heartbeat_state_mapping_table().
| bool daq::parse_environmental_data_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| EnvironmentalDataPacket & | data_out ) |
Parses an Environmental Data packet from buffer.
Definition at line 292 of file DiabloPacketUtils.cpp.
References ENVIRONMENTAL_DATA.
Referenced by fsw::streams::SensorFramePipeline::poll().
| bool daq::parse_log_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| uint8_t & | flags_out, | ||
| const uint8_t *& | text_out, | ||
| uint16_t & | text_len_out ) |
Parses a LOGS packet (type 15) from buffer.
Mirrors the on-wire format produced by create_log_packet: PacketHeader (LOGS) + flags (1B) + text_len (2B, uint16 LE) + text bytes. On success, text_out points into buffer (no copy) and is valid for the lifetime of buffer.
| flags_out | bit0 = TRUNCATED. |
| text_out | Set to point at the first text byte inside buffer. |
| text_len_out | Number of text bytes. |
Definition at line 807 of file DiabloPacketUtils.cpp.
Referenced by main(), test_log_packet_parse_truncated(), test_log_packet_parse_wrong_type(), and test_log_packet_roundtrip().
| bool daq::parse_pwm_actuator_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| std::vector< PWMActuatorCommand > & | commands_out ) |
Parses a PWM Actuator Command packet from buffer.
Definition at line 489 of file DiabloPacketUtils.cpp.
References ptr, and PWM_ACTUATOR_COMMAND.
Referenced by loop(), processIncomingPacket(), and test_pwm_actuator_roundtrip().
| bool daq::parse_self_test_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| uint8_t & | adc_good_out, | ||
| std::vector< SelfTestResult > & | results_out ) |
Parses a Self Test packet from buffer.
| adc_good_out | Set to 1 if the TDAC self-test passed, 0 if it failed. |
Definition at line 414 of file DiabloPacketUtils.cpp.
References ptr, and SELF_TEST.
Referenced by fsw::streams::SensorFramePipeline::poll(), test_self_test_adc_bad(), and test_self_test_roundtrip().
| bool daq::parse_sensor_config_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| std::vector< uint8_t > & | sensor_ids_out, | ||
| uint8_t & | reference_voltage_out, | ||
| bool & | necessary_for_abort_out, | ||
| uint32_t & | controller_ip_out, | ||
| uint8_t & | enable_serial_printing_out ) |
Parses a Sensor Config packet from buffer.
Mirrors the on-wire format produced by create_sensor_config_packet. If necessary_for_abort is false the controller_ip_out is set to 0.
Definition at line 578 of file DiabloPacketUtils.cpp.
References ptr, and SENSOR_CONFIG.
Referenced by SensorHotfire::processIncomingPacket(), SensorSM::processIncomingPacket(), test_sensor_config_empty_sensors(), test_sensor_config_roundtrip_with_abort(), and test_sensor_config_roundtrip_without_abort().
| bool daq::parse_sensor_data_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| std::vector< SensorDataChunkCollection > & | chunks_out ) |
Parses a Sensor Data packet from buffer into chunk collections.
Definition at line 326 of file DiabloPacketUtils.cpp.
References daq::SensorDataChunkCollection::datapoints, ptr, and SENSOR_DATA.
Referenced by fsw::config::BoardDiscovery::detect_sensors_from_packet(), fsw::streams::SensorFramePipeline::poll(), fsw::config::BoardDiscovery::process_sensor_data(), processIncomingPacket(), test_parse_null_buffer(), and test_sensor_data_roundtrip().
| bool daq::parse_server_heartbeat_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| ServerHeartbeatPacket & | data_out ) |
Parses a Server Heartbeat packet from buffer.
Definition at line 273 of file DiabloPacketUtils.cpp.
References SERVER_HEARTBEAT.
Referenced by decodeAndPrintPacket(), loop(), processIncomingPacket(), processIncomingPacket(), processIncomingPacket(), SensorHotfire::processIncomingPacket(), and test_server_heartbeat_roundtrip().
| bool daq::parse_stacklight_command_packet | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| PacketHeader & | header_out, | ||
| StacklightCommandPacket & | data_out ) |
Parses a Stacklight Command packet from buffer.
Definition at line 309 of file DiabloPacketUtils.cpp.
References STACKLIGHT_COMMAND.
Referenced by loop().