pub struct EspEth<'d, T> { /* private fields */ }Expand description
EspEth wraps an EthDriver Data Link layer instance, and binds the OSI
Layer 3 (network) facilities of ESP IDF to it.
In other words, it connects the ESP IDF ethernet Netif interface to the ethernet driver. This allows users to utilize the Rust STD APIs for working with TCP and UDP sockets.
This struct should be the default option for an ethernet driver in all use cases
but the niche one where bypassing the ESP IDF Netif and lwIP stacks is
desirable. E.g., using smoltcp or other custom IP stacks on top of the
ESP IDF ethernet peripheral.
Implementations§
Source§impl<'d, T> EspEth<'d, T>
impl<'d, T> EspEth<'d, T>
pub fn wrap(driver: EthDriver<'d, T>) -> Result<Self, EspError>
pub fn wrap_all( driver: EthDriver<'d, T>, netif: EspNetif, ) -> Result<Self, EspError>
pub fn swap_netif(&mut self, netif: EspNetif) -> Result<EspNetif, EspError>
pub fn driver(&self) -> &EthDriver<'d, T>
pub fn driver_mut(&mut self) -> &mut EthDriver<'d, T>
pub fn netif(&self) -> &EspNetif
pub fn netif_mut(&mut self) -> &mut EspNetif
pub fn start(&mut self) -> Result<(), EspError>
pub fn stop(&mut self) -> Result<(), EspError>
pub fn is_started(&self) -> Result<bool, EspError>
pub fn is_connected(&self) -> Result<bool, EspError>
pub fn is_up(&self) -> Result<bool, EspError>
Trait Implementations§
Source§impl<T> NetifStatus for EspEth<'_, T>
Available on esp_idf_comp_esp_netif_enabled only.
impl<T> NetifStatus for EspEth<'_, T>
Available on
esp_idf_comp_esp_netif_enabled only.Source§impl<T> NetifStatus for EspEth<'_, T>
Available on esp_idf_comp_esp_netif_enabled only.
impl<T> NetifStatus for EspEth<'_, T>
Available on
esp_idf_comp_esp_netif_enabled only.impl<T> Send for EspEth<'_, T>
Available on
esp_idf_comp_esp_netif_enabled only.