STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
SensorHotfire Namespace Reference

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}

Enumeration Type Documentation

◆ IncomingPacketKind

Enumerator
None 
ServerHeartbeat 
SensorConfig 
ClearAbort 
NoConnAbort 

Definition at line 55 of file SensorHotfireCore.h.

◆ State

enum class SensorHotfire::State : uint8_t
strong
Enumerator
WaitingForServer 
Active 
StandaloneAbort 
SelfTest 

Definition at line 48 of file SensorHotfireCore.h.

Function Documentation

◆ applyPacketTransition()

◆ flushLogs()

◆ loop()

◆ otaFreezeAddress()

void SensorHotfire::otaFreezeAddress ( void * user_data,
uint32_t image_bytes )
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().

◆ packetTypeName()

const char * SensorHotfire::packetTypeName ( uint8_t type)
inline

Definition at line 146 of file SensorHotfireCore.h.

References SENSOR_HOTFIRE_NO_CONN_ABORT_TYPE.

Referenced by loop().

◆ processIncomingPacket()

◆ readPacketHeader()

bool SensorHotfire::readPacketHeader ( const uint8_t * buffer,
size_t len,
daq::PacketHeader & hdr_out )
inline

Definition at line 138 of file SensorHotfireCore.h.

Referenced by processIncomingPacket().

◆ sendBoardHeartbeat()

void SensorHotfire::sendBoardHeartbeat ( CoreState & s,
const Config & cfg,
daq::BoardState board_state,
IPAddress dest_ip,
int dest_port )
inline

◆ setup()

◆ updateStateLed()

void SensorHotfire::updateStateLed ( CoreState & s,
const Config & cfg,
int state_num )
inline

Variable Documentation

◆ g_ota_server

StarOTA::Server SensorHotfire::g_ota_server {HOTFIRE_OTA_PORT}
inline

Definition at line 46 of file SensorHotfireCore.h.

Referenced by loop(), and setup().