ESPHome 2026.10.0-dev
Loading...
Searching...
No Matches
ethernet_component.cpp
Go to the documentation of this file.
2
3#ifdef USE_ETHERNET
4
5#include "esphome/core/log.h"
6
7namespace esphome::ethernet {
8
9EthernetComponent *global_eth_component; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
10
12
13#ifdef USE_ETHERNET_IP_STATE_LISTENERS
15 auto ips = this->get_ip_addresses();
16 auto dns1 = this->get_dns_address(0);
17 auto dns2 = this->get_dns_address(1);
18 for (auto *listener : this->ip_state_listeners_) {
19 listener->on_ip_state(ips, dns1, dns2);
20 }
21}
22#endif // USE_ETHERNET_IP_STATE_LISTENERS
23
24} // namespace esphome::ethernet
25
26#endif // USE_ETHERNET
network::IPAddress get_dns_address(uint8_t num)
StaticVector< EthernetIPStateListener *, ESPHOME_ETHERNET_IP_STATE_LISTENERS > ip_state_listeners_
EthernetComponent * global_eth_component