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

Namespaces

namespace  anonymous_namespace{STAR_EthernetOTA.cpp}

Classes

struct  Config
class  PortableServer
 Some Arduino-ESP32 cores make Server::begin() pure virtual as begin(uint16_t); others use begin(). More...
class  Server
 The OTA listener. More...

Enumerations

enum class  Result : uint8_t {
  Idle , Success , HeaderTimeout , BadSize ,
  BeginFailed , DataTimeout , WriteFailed , EndFailed
}
 Outcome of one OTA attempt. More...

Functions

const char * resultName (Result r)
 Human-readable form of a Result, for logs.
const char * testMessage ()
 The compiled-in test message ("" when none).
void printTestMessage ()
 Bench-test helper: prints STAR_OTA_TEST_MESSAGE on a timer as.

Enumeration Type Documentation

◆ Result

enum class StarOTA::Result : uint8_t
strong

Outcome of one OTA attempt.

Enumerator
Idle 

no client was waiting; nothing happened

Success 

image written; the board reboots unless told not to

HeaderTimeout 

client connected but never sent the 4-byte size

BadSize 

announced size was zero or implausibly large

BeginFailed 

Update.begin() refused (no OTA partition / too big).

DataTimeout 

transfer stalled partway through

WriteFailed 

flash write came up short

EndFailed 

image received but failed validation

Definition at line 81 of file STAR_EthernetOTA.h.

Function Documentation

◆ printTestMessage()

void StarOTA::printTestMessage ( )

Bench-test helper: prints STAR_OTA_TEST_MESSAGE on a timer as.

[OTA-MSG] <message>

so that uploading a build with a different message is immediately visible on the serial monitor. The Test-GUI bakes this flag, uploads, and watches for the line to change — which is the cheapest end-to-end proof that an OTA actually landed. No-op when no message was compiled in, so it is safe to leave the call in loop() on flight builds.

Definition at line 224 of file STAR_EthernetOTA.cpp.

References millis(), Serial, STAR_OTA_TEST_MESSAGE, and STAR_OTA_TEST_MESSAGE_INTERVAL_MS.

Referenced by loop(), SensorHotfire::loop(), and pollNetwork().

◆ resultName()

const char * StarOTA::resultName ( Result r)

Human-readable form of a Result, for logs.

Definition at line 24 of file STAR_EthernetOTA.cpp.

References BadSize, BeginFailed, DataTimeout, EndFailed, HeaderTimeout, Idle, r, Success, and WriteFailed.

◆ testMessage()

const char * StarOTA::testMessage ( )

The compiled-in test message ("" when none).

Definition at line 220 of file STAR_EthernetOTA.cpp.

References STAR_OTA_TEST_MESSAGE.

Referenced by currentMessage().