STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
hotfire_ota.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * Ethernet OTA for hotfire boards — thin compatibility layer.
5 *
6 * The implementation now lives in the shared library
7 * ``firmware/libraries/STAR_EthernetOTA``, so every STAR board with a W5500
8 * runs the same code. This header keeps the older names working; new code
9 * should include <STAR_EthernetOTA.h> and use StarOTA::Server directly.
10 *
11 * Wire protocol is unchanged:
12 * client -> board : [4-byte big-endian size][firmware binary]
13 * board -> client: "OK\r\n", then reboot
14 */
15
16#include <STAR_EthernetOTA.h>
17
18/** Legacy alias for the portability wrapper around EthernetServer. */
20
21/**
22 * Legacy blocking handler.
23 *
24 * Prefer StarOTA::Server::poll(), which owns the listening socket and the
25 * accept step too, so callers no longer hand-roll available()/handle().
26 */
27inline void hotfire_handleOTA(EthernetClient& client) {
28 // The adapter never listens (the caller owns the socket); it is here only
29 // to carry the config and run the transfer.
30 static StarOTA::Server adapter;
31 adapter.handleClient(client);
32}
Some Arduino-ESP32 cores make Server::begin() pure virtual as begin(uint16_t); others use begin().
The OTA listener.
Result handleClient(EthernetClient &client)
Run the transfer on a client you accepted yourself.
void hotfire_handleOTA(EthernetClient &client)
Legacy blocking handler.
Definition hotfire_ota.h:27