ESPHome
2026.10.0-dev
Loading...
Searching...
No Matches
esphome
components
ethernet
ethernet_component.cpp
Go to the documentation of this file.
1
#include "
ethernet_component.h
"
2
3
#ifdef USE_ETHERNET
4
5
#include "
esphome/core/log.h
"
6
7
namespace
esphome::ethernet
{
8
9
EthernetComponent
*
global_eth_component
;
// NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
10
11
EthernetComponent::EthernetComponent
() {
global_eth_component
=
this
; }
12
13
#ifdef USE_ETHERNET_IP_STATE_LISTENERS
14
void
EthernetComponent::notify_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
esphome::ethernet::EthernetComponent
Definition
ethernet_component.h:125
esphome::ethernet::EthernetComponent::notify_ip_state_listeners_
void notify_ip_state_listeners_()
Definition
ethernet_component.cpp:14
esphome::ethernet::EthernetComponent::get_ip_addresses
network::IPAddresses get_ip_addresses()
Definition
ethernet_component_esp32.cpp:635
esphome::ethernet::EthernetComponent::get_dns_address
network::IPAddress get_dns_address(uint8_t num)
Definition
ethernet_component_esp32.cpp:662
esphome::ethernet::EthernetComponent::ip_state_listeners_
StaticVector< EthernetIPStateListener *, ESPHOME_ETHERNET_IP_STATE_LISTENERS > ip_state_listeners_
Definition
ethernet_component.h:356
esphome::ethernet::EthernetComponent::EthernetComponent
EthernetComponent()
Definition
ethernet_component.cpp:11
ethernet_component.h
log.h
esphome::ethernet
Definition
automation.h:7
esphome::ethernet::global_eth_component
EthernetComponent * global_eth_component
Definition
ethernet_component.cpp:9
Generated by
1.12.0