|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Layer 1 (Physical) - link bring-up and egress reporting. More...
Go to the source code of this file.
Functions | |
| bool | init_wifi_physical (const char *ssid, const char *password) |
| Connect to a WiFi access point. | |
| bool | wifi_ready () |
| True if the WiFi station link is up (associated + an IP is assigned). | |
| bool | init_eth_physical (void) |
| Bring up a wired Ethernet link (DETWS_ENABLE_ETHERNET). | |
| bool | eth_ready (void) |
| True if the Ethernet link is up and an IP is assigned. | |
| bool | init_ipv6_physical (void) |
| Enable IPv6 (dual-stack) on the Wi-Fi interface (DETWS_ENABLE_IPV6). | |
| bool | net_global_ipv6 (DetIp *) |
| The interface's global (routable) IPv6 address, if it has one. | |
| bool | ipv6_ready (void) |
| True once the interface has a global IPv6 address (see net_global_ipv6()). | |
| uint32_t | det_net_egress_ip (void) |
| IPv4 (network byte order) of the current egress interface, or 0 if none. | |
| DetIface | det_net_egress (void) |
| Which interface currently carries outbound traffic. | |
| DetIface | det_net_classify_ip (uint32_t egress_ip, uint32_t sta_ip, uint32_t ap_ip) |
| Classify an egress IPv4 against the WiFi station / softAP IPs (pure helper, exposed for unit testing). | |
Layer 1 (Physical) - link bring-up and egress reporting.
WiFi station bring-up is asynchronous (poll wifi_ready()). det_net_egress() reports the live default-route interface (lwIP netif_default) and classifies it against the WiFi IPs; the stack owns failover, so there is nothing to poll or track here. The IP classifier is pure and host-tested.
Definition in file physical.cpp.
| bool init_wifi_physical | ( | const char * | ssid, |
| const char * | password | ||
| ) |
Connect to a WiFi access point.
Calls WiFi.begin() and returns immediately; it does not block waiting for association. Poll wifi_ready() to check link status.
| ssid | Network SSID (null-terminated). |
| password | WPA2 passphrase (null-terminated). |
Definition at line 24 of file physical.cpp.
| bool wifi_ready | ( | ) |
True if the WiFi station link is up (associated + an IP is assigned).
Definition at line 30 of file physical.cpp.
| bool init_eth_physical | ( | void | ) |
Bring up a wired Ethernet link (DETWS_ENABLE_ETHERNET).
A thin wrapper over the Arduino ETH library (ETH.begin()); the RMII PHY pins / type / clock come from the standard ETH_PHY_* build flags for your board. Returns immediately (bring-up is asynchronous); poll eth_ready(). The egress reporting already classifies a wired route as DetIface::DETIFACE_ETH, so the server accepts on the link once it has an IP.
Definition at line 55 of file physical.cpp.
| bool eth_ready | ( | void | ) |
True if the Ethernet link is up and an IP is assigned.
Definition at line 59 of file physical.cpp.
| bool init_ipv6_physical | ( | void | ) |
Enable IPv6 (dual-stack) on the Wi-Fi interface (DETWS_ENABLE_IPV6).
Turns on IPv6 for the netif so it acquires a SLAAC link-local address and, if the network advertises a prefix, a global address. Returns immediately (address configuration is asynchronous); poll ipv6_ready(). The listeners already bind IPADDR_TYPE_ANY, so the server answers over IPv6 as soon as an address is up.
Definition at line 104 of file physical.cpp.
| bool net_global_ipv6 | ( | DetIp * | out | ) |
The interface's global (routable) IPv6 address, if it has one.
| [out] | out | receives the address (family DetIpFamily::DET_IP_V6) when true is returned. |
Definition at line 108 of file physical.cpp.
| bool ipv6_ready | ( | void | ) |
True once the interface has a global IPv6 address (see net_global_ipv6()).
Definition at line 112 of file physical.cpp.
| uint32_t det_net_egress_ip | ( | void | ) |
IPv4 (network byte order) of the current egress interface, or 0 if none.
Definition at line 118 of file physical.cpp.
Referenced by det_net_egress().
| DetIface det_net_egress | ( | void | ) |
Which interface currently carries outbound traffic.
Reads the live lwIP default route, so it reflects the current state after any failover the stack performed - no polling, no cached state. Returns DetIface::DETIFACE_ETH / DetIface::DETIFACE_STA / DetIface::DETIFACE_AP, or DetIface::DETIFACE_ANY when no route is up (and on host builds).
Definition at line 124 of file physical.cpp.
References det_net_classify_ip(), det_net_egress_ip(), and DETIFACE_ANY.
| DetIface det_net_classify_ip | ( | uint32_t | egress_ip, |
| uint32_t | sta_ip, | ||
| uint32_t | ap_ip | ||
| ) |
Classify an egress IPv4 against the WiFi station / softAP IPs (pure helper, exposed for unit testing).
A live egress IP equal to the station or softAP IP is that WiFi interface; any other live IP is a wired (Ethernet) route; 0 is no route.
| egress_ip | Current default-route IPv4 (network order), 0 if none. |
| sta_ip | WiFi station IPv4 (network order), 0 if not connected. |
| ap_ip | softAP IPv4 (network order), 0 if the softAP is not up. |
Definition at line 176 of file physical.cpp.
References DETIFACE_ANY, DETIFACE_AP, DETIFACE_ETH, and DETIFACE_STA.
Referenced by det_net_egress().