ESPHome 2026.8.0-dev
Loading...
Searching...
No Matches
esphome::network Namespace Reference

Data Structures

struct  IPAddress
 
class  NetworkComponent
 

Typedefs

using IPAddresses = std::array<IPAddress, 5>
 

Functions

void lowercase_ip_str (char *buf)
 Lowercase hex digits in IP address string (A-F -> a-f for IPv6 per RFC 5952)
 
bool is_disabled ()
 Return whether the network is disabled (only wifi for now)
 
const char * get_use_address_to (std::span< char, USE_ADDRESS_BUFFER_SIZE > buf)
 Get the active network address for logging.
 
network::IPAddresses get_ip_addresses ()
 
ESPHOME_ALWAYS_INLINE bool is_connected ()
 Return whether the node is connected to the network (through wifi, eth, ...)
 

Typedef Documentation

◆ IPAddresses

using esphome::network::IPAddresses = std::array<IPAddress, 5>

Definition at line 299 of file ip_address.h.

Function Documentation

◆ get_ip_addresses()

IPAddresses esphome::network::get_ip_addresses ( )

Definition at line 51 of file util.cpp.

◆ get_use_address_to()

const char * esphome::network::get_use_address_to ( std::span< char, USE_ADDRESS_BUFFER_SIZE > buf)

Get the active network address for logging.

Returns the explicitly configured use_address when one was set (from the highest-priority interface when network: priority: is configured), otherwise formats "<name>.local" from the runtime device name into buf (so it includes the MAC suffix from name_add_mac_suffix).

Definition at line 25 of file util.cpp.

◆ is_connected()

ESPHOME_ALWAYS_INLINE bool esphome::network::is_connected ( )
inline

Return whether the node is connected to the network (through wifi, eth, ...)

Definition at line 28 of file util.h.

◆ is_disabled()

bool esphome::network::is_disabled ( )

Return whether the network is disabled (only wifi for now)

Definition at line 12 of file util.cpp.

◆ lowercase_ip_str()

void esphome::network::lowercase_ip_str ( char * buf)
inline

Lowercase hex digits in IP address string (A-F -> a-f for IPv6 per RFC 5952)

Definition at line 80 of file ip_address.h.