ESPHome
2023.8.3
|
#include <ethernet_component.h>
Public Member Functions | |
EthernetComponent () | |
void | setup () override |
void | loop () override |
void | dump_config () override |
float | get_setup_priority () const override |
bool | can_proceed () override |
void | on_shutdown () override |
bool | is_connected () |
void | set_phy_addr (uint8_t phy_addr) |
void | set_power_pin (int power_pin) |
void | set_mdc_pin (uint8_t mdc_pin) |
void | set_mdio_pin (uint8_t mdio_pin) |
void | set_type (EthernetType type) |
void | set_clk_mode (emac_rmii_clock_mode_t clk_mode, emac_rmii_clock_gpio_t clk_gpio) |
void | set_manual_ip (const ManualIP &manual_ip) |
network::IPAddress | get_ip_address () |
std::string | get_use_address () const |
void | set_use_address (const std::string &use_address) |
bool | powerdown () |
![]() | |
float | get_actual_setup_priority () const |
void | set_setup_priority (float priority) |
virtual float | get_loop_priority () const |
priority of loop(). More... | |
void | call () |
virtual void | on_safe_shutdown () |
uint32_t | get_component_state () const |
virtual void | mark_failed () |
Mark this component as failed. More... | |
bool | is_failed () |
bool | is_ready () |
bool | status_has_warning () |
bool | status_has_error () |
void | status_set_warning () |
void | status_set_error () |
void | status_clear_warning () |
void | status_clear_error () |
void | status_momentary_warning (const std::string &name, uint32_t length=5000) |
void | status_momentary_error (const std::string &name, uint32_t length=5000) |
bool | has_overridden_loop () const |
void | set_component_source (const char *source) |
Set where this component was loaded from for some debug messages. More... | |
const char * | get_component_source () const |
Get the integration where this component was declared as a string. More... | |
Protected Member Functions | |
void | start_connect_ () |
void | dump_connect_params_ () |
void | ksz8081_set_clock_reference_ (esp_eth_mac_t *mac) |
Set RMII Reference Clock Select bit for KSZ8081. More... | |
![]() | |
virtual void | call_loop () |
virtual void | call_setup () |
virtual void | call_dump_config () |
void | set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f) |
Set an interval function with a unique name. More... | |
void | set_interval (uint32_t interval, std::function< void()> &&f) |
bool | cancel_interval (const std::string &name) |
Cancel an interval function. More... | |
void | set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
Set an retry function with a unique name. More... | |
void | set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
bool | cancel_retry (const std::string &name) |
Cancel a retry function. More... | |
void | set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f) |
Set a timeout function with a unique name. More... | |
void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
bool | cancel_timeout (const std::string &name) |
Cancel a timeout function. More... | |
void | defer (const std::string &name, std::function< void()> &&f) |
Defer a callback to the next loop() call. More... | |
void | defer (std::function< void()> &&f) |
Defer a callback to the next loop() call. More... | |
bool | cancel_defer (const std::string &name) |
Cancel a defer callback using the specified name, name must not be empty. More... | |
Static Protected Member Functions | |
static void | eth_event_handler (void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) |
static void | got_ip_event_handler (void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) |
static void | got_ip6_event_handler (void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) |
Protected Attributes | |
std::string | use_address_ |
uint8_t | phy_addr_ {0} |
int | power_pin_ {-1} |
uint8_t | mdc_pin_ {23} |
uint8_t | mdio_pin_ {18} |
EthernetType | type_ {ETHERNET_TYPE_UNKNOWN} |
emac_rmii_clock_mode_t | clk_mode_ {EMAC_CLK_EXT_IN} |
emac_rmii_clock_gpio_t | clk_gpio_ {EMAC_CLK_IN_GPIO} |
optional< ManualIP > | manual_ip_ {} |
bool | started_ {false} |
bool | connected_ {false} |
bool | got_ipv6_ {false} |
uint8_t | ipv6_count_ {0} |
EthernetComponentState | state_ {EthernetComponentState::STOPPED} |
uint32_t | connect_begin_ |
esp_netif_t * | eth_netif_ {nullptr} |
esp_eth_handle_t | eth_handle_ |
esp_eth_phy_t * | phy_ {nullptr} |
![]() | |
uint32_t | component_state_ {0x0000} |
State of this component. More... | |
float | setup_priority_override_ {NAN} |
const char * | component_source_ {nullptr} |
Definition at line 41 of file ethernet_component.h.
esphome::ethernet::EthernetComponent::EthernetComponent | ( | ) |
Definition at line 25 of file ethernet_component.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 234 of file ethernet_component.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 185 of file ethernet_component.cpp.
|
protected |
Definition at line 360 of file ethernet_component.cpp.
|
staticprotected |
Definition at line 242 of file ethernet_component.cpp.
network::IPAddress esphome::ethernet::EthernetComponent::get_ip_address | ( | ) |
Definition at line 236 of file ethernet_component.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 232 of file ethernet_component.cpp.
std::string esphome::ethernet::EthernetComponent::get_use_address | ( | ) | const |
Definition at line 421 of file ethernet_component.cpp.
|
staticprotected |
Definition at line 276 of file ethernet_component.cpp.
|
staticprotected |
Definition at line 269 of file ethernet_component.cpp.
bool esphome::ethernet::EthernetComponent::is_connected | ( | ) |
Definition at line 358 of file ethernet_component.cpp.
|
protected |
Set RMII Reference Clock Select
bit for KSZ8081.
Definition at line 445 of file ethernet_component.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 131 of file ethernet_component.cpp.
|
inlineoverridevirtual |
Reimplemented from esphome::Component.
Definition at line 49 of file ethernet_component.h.
bool esphome::ethernet::EthernetComponent::powerdown | ( | ) |
Definition at line 430 of file ethernet_component.cpp.
void esphome::ethernet::EthernetComponent::set_clk_mode | ( | emac_rmii_clock_mode_t | clk_mode, |
emac_rmii_clock_gpio_t | clk_gpio | ||
) |
Definition at line 415 of file ethernet_component.cpp.
void esphome::ethernet::EthernetComponent::set_manual_ip | ( | const ManualIP & | manual_ip | ) |
Definition at line 419 of file ethernet_component.cpp.
void esphome::ethernet::EthernetComponent::set_mdc_pin | ( | uint8_t | mdc_pin | ) |
Definition at line 412 of file ethernet_component.cpp.
void esphome::ethernet::EthernetComponent::set_mdio_pin | ( | uint8_t | mdio_pin | ) |
Definition at line 413 of file ethernet_component.cpp.
void esphome::ethernet::EthernetComponent::set_phy_addr | ( | uint8_t | phy_addr | ) |
Definition at line 410 of file ethernet_component.cpp.
void esphome::ethernet::EthernetComponent::set_power_pin | ( | int | power_pin | ) |
Definition at line 411 of file ethernet_component.cpp.
void esphome::ethernet::EthernetComponent::set_type | ( | EthernetType | type | ) |
Definition at line 414 of file ethernet_component.cpp.
void esphome::ethernet::EthernetComponent::set_use_address | ( | const std::string & | use_address | ) |
Definition at line 428 of file ethernet_component.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 27 of file ethernet_component.cpp.
|
protected |
Definition at line 284 of file ethernet_component.cpp.
|
protected |
Definition at line 84 of file ethernet_component.h.
|
protected |
Definition at line 83 of file ethernet_component.h.
|
protected |
Definition at line 94 of file ethernet_component.h.
|
protected |
Definition at line 88 of file ethernet_component.h.
|
protected |
Definition at line 96 of file ethernet_component.h.
|
protected |
Definition at line 95 of file ethernet_component.h.
|
protected |
Definition at line 90 of file ethernet_component.h.
|
protected |
Definition at line 91 of file ethernet_component.h.
Definition at line 85 of file ethernet_component.h.
|
protected |
Definition at line 80 of file ethernet_component.h.
|
protected |
Definition at line 81 of file ethernet_component.h.
|
protected |
Definition at line 97 of file ethernet_component.h.
|
protected |
Definition at line 78 of file ethernet_component.h.
|
protected |
Definition at line 79 of file ethernet_component.h.
|
protected |
Definition at line 87 of file ethernet_component.h.
|
protected |
Definition at line 93 of file ethernet_component.h.
|
protected |
Definition at line 82 of file ethernet_component.h.
|
protected |
Definition at line 77 of file ethernet_component.h.