Skip to content

File espos_eth.h

FileList > espos_eth > include > espos_eth.h

Go to the source code of this file

  • #include <stdbool.h>
  • #include "esp_err.h"

Public Functions

Type Name
bool espos_eth_link_up (void)
True while the PHY reports a valid link.
esp_err_t espos_eth_start (void)
Bring Ethernet up: EMAC, PHY, netif, DHCP.
esp_err_t espos_eth_stop (void)
Stop the driver and report the link down.

Public Functions Documentation

True while the PHY reports a valid link.

bool espos_eth_link_up (
    void
) 

Independent of addressing: a cable can be plugged in with no DHCP server answering.


function espos_eth_start

Bring Ethernet up: EMAC, PHY, netif, DHCP.

esp_err_t espos_eth_start (
    void
) 

Returns once the driver has started the link and the address arrive later, and are reported into espos_net as they do. Requires espos_net_start() first (espos_start() does both, in order): the netif takes its hostname from espos_net before the first DHCP request goes out.

ESP_ERR_NOT_SUPPORTED on a chip without an internal EMAC, or with CONFIG_ETH_USE_ESP32_EMAC off. Idempotent.


function espos_eth_stop

Stop the driver and report the link down.

esp_err_t espos_eth_stop (
    void
) 

The netif and the driver stay allocated: IDF's Ethernet teardown does not reliably return to a state a later start can build on, and a transport that cannot restart is worse than one that keeps a few KB. A later espos_eth_start() restarts it.



The documentation for this class was generated from the following file espos_eth/include/espos_eth.h