|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| struct | StoredSensorConfig |
| struct | Config |
| struct | CoreState |
Enumerations | |
| enum class | State : uint8_t { WaitingForServer = 1 , Active = 2 , StandaloneAbort = 9 , SelfTest = 10 } |
| enum class | IncomingPacketKind { None , ServerHeartbeat , SensorConfig , ClearAbort , NoConnAbort } |
Functions | |
| void | otaFreezeAddress (void *user_data, uint32_t image_bytes) |
| Freeze the board's address before a single byte reaches flash. | |
| bool | readPacketHeader (const uint8_t *buffer, size_t len, daq::PacketHeader &hdr_out) |
| const char * | packetTypeName (uint8_t type) |
| IncomingPacketKind | processIncomingPacket (CoreState &s, const Config &cfg, const uint8_t *buffer, size_t len, IPAddress remote_ip, int remote_port) |
| void | applyPacketTransition (CoreState &s, const Config &cfg, IncomingPacketKind kind) |
| void | sendBoardHeartbeat (CoreState &s, const Config &cfg, daq::BoardState board_state, IPAddress dest_ip, int dest_port) |
| void | updateStateLed (CoreState &s, const Config &cfg, int state_num) |
| void | flushLogs (CoreState &s) |
| void | setup (CoreState &s, const Config &cfg) |
| void | loop (CoreState &s, const Config &cfg) |
Variables | |
| StarOTA::Server | g_ota_server {HOTFIRE_OTA_PORT} |
|
strong |
| Enumerator | |
|---|---|
| None | |
| ServerHeartbeat | |
| SensorConfig | |
| ClearAbort | |
| NoConnAbort | |
Definition at line 55 of file SensorHotfireCore.h.
|
strong |
| Enumerator | |
|---|---|
| WaitingForServer | |
| Active | |
| StandaloneAbort | |
| SelfTest | |
Definition at line 48 of file SensorHotfireCore.h.
|
inline |
Definition at line 284 of file SensorHotfireCore.h.
References Active, ClearAbort, SensorHotfire::StoredSensorConfig::necessary_for_abort, NoConnAbort, SelfTest, SensorConfig, Serial, StandaloneAbort, SensorHotfire::CoreState::state, SensorHotfire::CoreState::stored_config, and WaitingForServer.
Referenced by loop().
|
inline |
Definition at line 383 of file SensorHotfireCore.h.
References daq::create_log_packet(), g_logbuf, LOG_BUF_SIZE, millis(), SensorHotfire::CoreState::serverIP, SensorHotfire::CoreState::serverPort, and SensorHotfire::CoreState::udp.
Definition at line 513 of file SensorHotfireCore.h.
References daq::ACTIVE, Active, SensorHotfire::StoredSensorConfig::actuator_controller_ip, applyPacketTransition(), BOARD_HEARTBEAT_INTERVAL_MS, SensorHotfire::CoreState::board_id, BoardNet::boardId(), daq::create_self_test_packet(), delay(), SensorHotfire::CoreState::dns, Ethernet, flushLogs(), g_logbuf, g_ota_server, SensorHotfire::CoreState::gateway, HEX, HF_LOG, HF_LOGLN, HF_LOGLN_, HF_VERBOSE, HF_VERBOSELN, HF_VERBOSELN_, HOTFIRE_SERVER_IP_OCTET_4, HOTFIRE_SERVER_PORT, IPAddress, SensorHotfire::CoreState::lastHeartbeatMillis, LOOP_DELAY_MS, BoardNet::maintainLease(), millis(), SensorHotfire::CoreState::net, packetBuffer, packetTypeName(), StarOTA::printTestMessage(), processIncomingPacket(), BoardNet::retryDhcp(), daq::SELF_TEST, SelfTest, sendBoardHeartbeat(), SENSOR_HOTFIRE_MAX_PACKET_SIZE, SensorConfig, Serial, SensorHotfire::CoreState::serverIP, BoardNet::State::serverLearned, SensorHotfire::CoreState::serverPort, SensorHotfire::CoreState::serverPortDefault, BoardNet::serverWentSilent(), daq::SETUP, daq::STANDALONE_ABORT, StandaloneAbort, SensorHotfire::CoreState::state, SensorHotfire::CoreState::stored_config, SensorHotfire::CoreState::udp, updateStateLed(), SensorHotfire::StoredSensorConfig::valid, and WaitingForServer.
Referenced by loop().
|
inline |
Freeze the board's address before a single byte reaches flash.
Our address comes from a DHCP lease, and a renewal that landed mid-flash would move us and drop the transfer, so this suspends renewals for the duration.
Definition at line 129 of file SensorHotfireCore.h.
References BoardNet::beginOtaHold(), and net.
Referenced by setup().
|
inline |
Definition at line 146 of file SensorHotfireCore.h.
References SENSOR_HOTFIRE_NO_CONN_ABORT_TYPE.
Referenced by loop().
|
inline |
Definition at line 177 of file SensorHotfireCore.h.
References SensorHotfire::StoredSensorConfig::actuator_controller_ip, daq::CLEAR_ABORT, ClearAbort, g_log_stream_level, g_verbose, HF_LOGLN, HF_VERBOSE, HF_VERBOSELN, HF_VERBOSELN_, MAX_SENSORS_PER_BOARD, SensorHotfire::StoredSensorConfig::necessary_for_abort, SensorHotfire::CoreState::net, daq::NO_CONNECTION_ABORT, NoConnAbort, None, SensorHotfire::StoredSensorConfig::num_sensors, BoardNet::onServerPacket(), daq::parse_sensor_config_packet(), daq::parse_server_heartbeat_packet(), readPacketHeader(), SensorHotfire::StoredSensorConfig::reference_voltage, daq::SENSOR_CONFIG, SensorHotfire::StoredSensorConfig::sensor_ids, SensorConfig, Serial, daq::SERVER_HEARTBEAT, ServerHeartbeat, SensorHotfire::CoreState::serverIP, SensorHotfire::CoreState::stored_config, and SensorHotfire::StoredSensorConfig::valid.
Referenced by loop().
|
inline |
Definition at line 138 of file SensorHotfireCore.h.
Referenced by processIncomingPacket().
|
inline |
Definition at line 321 of file SensorHotfireCore.h.
References SensorHotfire::CoreState::board_id, daq::create_board_heartbeat_packet(), FirmwareHash::get(), HF_VERBOSE, HF_VERBOSELN, millis(), packetBuffer, daq::SAFE, SENSOR_HOTFIRE_MAX_PACKET_SIZE, and SensorHotfire::CoreState::udp.
Definition at line 398 of file SensorHotfireCore.h.
References BoardNet::begin(), BOARD_ID, SensorHotfire::CoreState::board_id, BoardNet::boardId(), BoardNet::configure(), delay(), digitalWrite(), SensorHotfire::CoreState::dns, Ethernet, ETHERNET_BEGIN_DELAY_MS, ETHERNET_INIT_DELAY_MS, ETHERNET_SPI_DELAY_MS, flushLogs(), g_ota_server, SensorHotfire::CoreState::gateway, HF_LOG, HF_LOGLN, HF_LOGLN_, HOTFIRE_SERVER_IP_OCTET_4, HOTFIRE_SERVER_PORT, IPAddress, SensorHotfire::CoreState::lastHeartbeatMillis, LOW, SensorHotfire::CoreState::mac, SensorHotfire::CoreState::net, otaFreezeAddress(), OUTPUT, pinMode(), Pins, FirmwareHash::print(), BoardNet::printMac(), SENSOR_UDP_LISTEN_PORT, Serial, SERIAL_MONITOR_READY_DELAY_MS, SensorHotfire::CoreState::serverIP, SensorHotfire::CoreState::serverPort, BoardNet::State::source, BoardNet::sourceName(), SensorHotfire::CoreState::state, SensorHotfire::CoreState::staticIP, SensorHotfire::CoreState::subnet, SensorHotfire::CoreState::udp, and WaitingForServer.
Referenced by setup().
Definition at line 344 of file SensorHotfireCore.h.
References digitalWrite(), HIGH, SensorHotfire::CoreState::last_led_cycle_millis, SensorHotfire::CoreState::last_led_edge_millis, SensorHotfire::CoreState::led_blink_index, SensorHotfire::CoreState::led_on, LOW, and millis().
Referenced by loop().
|
inline |
Definition at line 46 of file SensorHotfireCore.h.