prf::net::eth::IEthernetDevice class

Abstraction of Ethernet-capable L2 device used by lwIP netif runtime.

The implementation is expected to come from HAL (for example W5500 MACRAW backend) and be injected into this runtime by upper composition layers.

Derived classes

class prf::hal::usb::NcmEthDeviceAdapter final
Ethernet-device adapter over TinyUSB NCM backend.
class prf::hal::wizchip::W5500EthDeviceAdapter final
Ethernet-device adapter over W5500 MACRAW HAL backend.

Constructors, destructors, conversion operators

~IEthernetDevice() defaulted virtual

Public functions

auto dequeue_rx_frame(uint8_t* out, size_t out_capacity, size_t* out_size) -> bool pure virtual
Dequeues one received Ethernet frame.
auto enqueue_tx_frame(const uint8_t* frame, size_t frame_size) -> bool pure virtual
Queues one complete Ethernet frame for transmission.
auto init() -> bool pure virtual
Initializes backend transport and device state.
auto link_up() const -> bool pure virtual
Returns current physical link state.
auto mac_address() const -> const uint8_t* pure virtual
Returns 6-byte source MAC identity used by lwIP for this interface.
auto mtu_bytes() const -> size_t pure virtual
Returns maximum Ethernet frame size without FCS.
auto ready() const -> bool pure virtual
Returns true when backend can exchange Ethernet frames.
void service() pure virtual
Runs backend periodic servicing (polling, deferred completion, etc.).
void set_rx_wakeup_context(TaskHandle_t task_handle) pure virtual
Attaches network-task wake handle used by IRQ-capable backends.

Function documentation

size_t prf::net::eth::IEthernetDevice::mtu_bytes() const pure virtual

Returns maximum Ethernet frame size without FCS.

Contract: value is full Ethernet frame length (L2 header + payload), excluding the 4-byte FCS trailer. Typical Ethernet value is 1514 bytes.