|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Sensor state machine unit tests. More...
Classes | |
| struct | StoredConfig |
Enumerations | |
| enum class | State : uint8_t { WaitingForServer = 1 , Active = 2 , StandaloneAbort = 9 , SelfTest = 10 } |
| enum class | IncomingPacketKind { None , ServerHeartbeat , SensorConfig , NoConnAbort , ClearAbort } |
Functions | |
| static State | applyPacketTransition (State state, IncomingPacketKind kind, bool necessary_for_abort, bool run_self_test) |
| static IncomingPacketKind | readPacketHeader (const uint8_t *buf, size_t len) |
| static IncomingPacketKind | processIncomingPacket (StoredConfig &stored_config, const uint8_t *buf, size_t len) |
| static daq::BoardState | getBoardStateForHeartbeat (State state) |
Sensor state machine unit tests.
Tests the sensor state machine transitions, packet processing, and heartbeat state encoding.
Rather than including SensorHotfireCore.h directly (which pulls in heavy ESP32 dependencies), we extract the testable pure-logic functions here. This mirrors the approach used for the actuator tests.
|
strong |
| Enumerator | |
|---|---|
| None | |
| ServerHeartbeat | |
| SensorConfig | |
| NoConnAbort | |
| ClearAbort | |
Definition at line 36 of file test_sensor_state_machine.cpp.
|
strong |
| Enumerator | |
|---|---|
| WaitingForServer | |
| Active | |
| StandaloneAbort | |
| SelfTest | |
Definition at line 29 of file test_sensor_state_machine.cpp.
|
static |
Definition at line 56 of file test_sensor_state_machine.cpp.
References Active, ClearAbort, NoConnAbort, SelfTest, SensorConfig, StandaloneAbort, state, and WaitingForServer.
Referenced by test_sensor_clear_abort_in_active_stays(), test_sensor_clear_abort_returns_to_active(), test_sensor_config_transitions_to_active(), test_sensor_config_transitions_to_selftest(), test_sensor_heartbeat_stays_waiting(), test_sensor_noconn_abort_with_necessary(), test_sensor_noconn_abort_without_necessary(), and test_sensor_none_packet_doesnt_transition().
|
static |
Definition at line 135 of file test_sensor_state_machine.cpp.
References daq::ACTIVE, Active, daq::SELF_TEST, SelfTest, daq::SETUP, daq::STANDALONE_ABORT, StandaloneAbort, state, and WaitingForServer.
Referenced by test_sensor_heartbeat_state_mapping_table().
|
static |
Definition at line 103 of file test_sensor_state_machine.cpp.
References daq::parse_sensor_config_packet(), readPacketHeader(), SensorConfig, and stored_config.
Referenced by test_sensor_process_clear_abort_packet(), test_sensor_process_sensor_config_packet(), test_sensor_process_sensor_config_with_abort(), test_sensor_process_server_heartbeat_packet(), and test_sensor_process_too_short_returns_none().
|
static |
Definition at line 85 of file test_sensor_state_machine.cpp.
References daq::CLEAR_ABORT, ClearAbort, None, daq::SENSOR_CONFIG, SensorConfig, daq::SERVER_HEARTBEAT, and ServerHeartbeat.
Referenced by processIncomingPacket().