26 if (sta_ip != 0 && egress_ip == sta_ip)
30 if (ap_ip != 0 && egress_ip == ap_ip)
37#if !PC_PHYSICAL_HAS_BACKEND
bool init_wifi_physical(const char *, const char *)
Connect to a WiFi access point.
bool pc_ipv6_ready(void)
True once the interface has a global IPv6 address (see net_global_ipv6()).
pc_iface pc_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)...
uint32_t pc_net_egress_ip(void)
IPv4 (network byte order) of the current egress interface, or 0 if none.
pc_phy_ps pc_phy_ps_get(void)
Read the active power-save mode (PC_PHY_PS_NONE when unsupported).
bool eth_ready(void)
True if the Ethernet link is up and an IP is assigned.
bool pc_phy_monitor_begin(uint8_t, pc_phy_frame_fn)
Enter monitor mode on channel, delivering frames to cb.
bool pc_net_egress_mac(uint8_t *)
bool init_wifi_ap_physical(const char *, const char *)
Bring up a softAP, enabling AP+STA coexistence so a station link can run alongside it.
bool net_global_ipv6(pc_ip *)
The interface's global (routable) IPv6 address, if it has one.
bool pc_phy_tx_power_set(int8_t)
Cap transmit power.
size_t pc_net_ssid(char *out, size_t cap)
Copy the associated SSID (null-terminated) into out.
bool wifi_ready()
True if the WiFi station link is up (associated + an IP is assigned).
int8_t pc_net_rssi(void)
Station link RSSI in dBm, or 0 if not associated (and on host builds).
void pc_phy_monitor_end(void)
Leave monitor mode.
uint32_t pc_net_ap_ip(void)
softAP IPv4 (network byte order), or 0 if the softAP is not up (and on host builds).
bool init_ipv6_physical(void)
Enable IPv6 (dual-stack) on the Wi-Fi interface (PC_ENABLE_IPV6).
bool init_eth_physical(void)
Bring up a wired Ethernet link (PC_ENABLE_ETHERNET).
pc_iface pc_net_egress(void)
Which interface currently carries outbound traffic.
void pc_phy_monitor_set_channel(uint8_t)
Retune monitor mode to channel.
uint8_t pc_net_channel(void)
Station WiFi channel (1..14), or 0 if not associated (and on host builds).
bool pc_phy_ps_set(pc_phy_ps)
Apply a power-save mode.
bool init_wifi_radio_physical(uint8_t)
Bring the WiFi radio up in station mode WITHOUT associating to an AP.
bool pc_net_mac(uint8_t *)
Layer 1 (Physical) - link bring-up and live egress-interface reporting.
void(* pc_phy_frame_fn)(const uint8_t *frame, uint16_t len, int8_t rssi, uint8_t channel)
One received frame, delivered in neutral terms.
pc_phy_ps
Radio power-save mode, in the library's own vocabulary.
@ PC_PHY_PS_NONE
Radio always on: lowest latency, highest average draw.
pc_iface
Network interface a connection arrived on (for per-route filtering).
@ PC_IFACE_AP
softAP interface (clients joined to the device).
@ PC_IFACE_ETH
Ethernet interface (wired PHY).
@ PC_IFACE_STA
Station interface (joined to an AP / your LAN).
@ PC_IFACE_ANY
Unknown / no filter (matches any interface).
A v4 or v6 address in network (big-endian) byte order.