STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
board_net.h File Reference
#include <Arduino.h>
#include <Ethernet.h>
#include "hotfire_config.h"
Include dependency graph for board_net.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BoardNet::State

Namespaces

namespace  BoardNet
 Board networking — the ground station decides addresses, not the board.

Enumerations

enum class  BoardNet::AddressSource : uint8_t { BoardNet::None , BoardNet::Dhcp , BoardNet::Recovery }
 How the board ended up with the address it is using. More...

Functions

const char * BoardNet::sourceName (AddressSource s)
IPAddress BoardNet::recoverySubnet ()
 Subnet of the recovery address: link-local, 169.254.0.0/16.
IPAddress BoardNet::recoveryAddress (const byte mac[6])
 The board's recovery address, from its MAC: 169.254.
void BoardNet::configure (State &s, const byte mac[6])
void BoardNet::printMac (const State &s)
 Print the MAC as aa:bb:cc:dd:ee:ff.
bool BoardNet::usingDhcp (const State &s)
bool BoardNet::hasAddress (const State &s)
uint8_t BoardNet::boardId (const State &s)
 The board's ID: the last octet of the address the server assigned (192.168.2.31 -> 31).
void BoardNet::maintainLease (State &s)
 Renew the lease as it expires.
void BoardNet::beginOtaHold (State &s)
 Called when an OTA transfer starts, so the address cannot move under it.
bool BoardNet::onServerPacket (State &s, IPAddress remote_ip, IPAddress &serverIP)
 A server packet arrived from remote_ip; adopt it as the server address.
bool BoardNet::serverWentSilent (const State &s)
 Server has stopped talking — forget it and resume discovery broadcasts.
void BoardNet::useRecoveryAddress (State &s, IPAddress dns, IPAddress gateway)
AddressSource BoardNet::begin (State &s, IPAddress dns, IPAddress gateway)
 Bring the interface up: ask the ground station for an address, and take the recovery address only if nothing answers.
bool BoardNet::retryDhcp (State &s, IPAddress dns, IPAddress gateway)
 On the recovery address, ask for a lease again every SENSOR_ETH_DHCP_RETRY_INTERVAL_MS.