ESPHome  2024.11.3
Data Structures | Typedefs | Enumerations | Functions | Variables
esphome::wifi Namespace Reference

Data Structures

struct  EAPAuth
 
struct  ManualIP
 Struct for setting static IPs in WiFiComponent. More...
 
struct  SavedWifiFastConnectSettings
 
struct  SavedWifiSettings
 
class  WiFiAP
 
class  WiFiComponent
 This component is responsible for managing the ESP WiFi interface. More...
 
class  WiFiConnectedCondition
 
class  WiFiDisableAction
 
class  WiFiEnableAction
 
class  WiFiEnabledCondition
 
class  WiFiScanResult
 
struct  WiFiSTAPriority
 

Typedefs

using bssid_t = std::array< uint8_t, 6 >
 
using esphome_ip4_addr_t = esp_ip4_addr_t
 
using esphome_wifi_event_id_t = arduino_event_id_t
 
using esphome_wifi_event_info_t = arduino_event_info_t
 

Enumerations

enum  WiFiComponentState {
  WIFI_COMPONENT_STATE_OFF = 0, WIFI_COMPONENT_STATE_DISABLED, WIFI_COMPONENT_STATE_COOLDOWN, WIFI_COMPONENT_STATE_STA_SCANNING,
  WIFI_COMPONENT_STATE_STA_CONNECTING, WIFI_COMPONENT_STATE_STA_CONNECTING_2, WIFI_COMPONENT_STATE_STA_CONNECTED, WIFI_COMPONENT_STATE_AP
}
 
enum  WiFiSTAConnectStatus : int {
  WiFiSTAConnectStatus::IDLE, WiFiSTAConnectStatus::CONNECTING, WiFiSTAConnectStatus::CONNECTED, WiFiSTAConnectStatus::ERROR_NETWORK_NOT_FOUND,
  WiFiSTAConnectStatus::ERROR_CONNECT_FAILED
}
 
enum  WiFiPowerSaveMode { WIFI_POWER_SAVE_NONE = 0, WIFI_POWER_SAVE_LIGHT, WIFI_POWER_SAVE_HIGH }
 

Functions

const LogString * get_signal_bars (int8_t rssi)
 
const char * get_auth_mode_str (uint8_t mode)
 
std::string format_ip4_addr (const esphome_ip4_addr_t &ip)
 
const char * get_op_mode_str (uint8_t mode)
 
const char * get_disconnect_reason_str (uint8_t reason)
 
struct netif * eagle_lwip_getif (int netif_index)
 
void netif_set_addr (struct netif *netif, const ip4_addr_t *ip, const ip4_addr_t *netmask, const ip4_addr_t *gw)
 
std::string format_ip_addr (struct ipv4_addr ip)
 
std::string format_ip_addr (struct ip_addr ip)
 
void event_handler (void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
 
std::string format_ip6_addr (const esp_ip6_addr_t &ip)
 

Variables

WiFiComponentglobal_wifi_component
 
struct esphome::wifi::SavedWifiSettings PACKED
 

Typedef Documentation

◆ bssid_t

using esphome::wifi::bssid_t = typedef std::array<uint8_t, 6>

Definition at line 121 of file wifi_component.h.

◆ esphome_ip4_addr_t

Definition at line 386 of file wifi_component_esp32_arduino.cpp.

◆ esphome_wifi_event_id_t

typedef arduino_event_id_t esphome::wifi::esphome_wifi_event_id_t

Definition at line 493 of file wifi_component_esp32_arduino.cpp.

◆ esphome_wifi_event_info_t

typedef arduino_event_info_t esphome::wifi::esphome_wifi_event_info_t

Definition at line 494 of file wifi_component_esp32_arduino.cpp.

Enumeration Type Documentation

◆ WiFiComponentState

Enumerator
WIFI_COMPONENT_STATE_OFF 

Nothing has been initialized yet.

Internal AP, if configured, is disabled at this point.

WIFI_COMPONENT_STATE_DISABLED 

WiFi is disabled.

WIFI_COMPONENT_STATE_COOLDOWN 

WiFi is in cooldown mode because something went wrong, scanning will begin after a short period of time.

WIFI_COMPONENT_STATE_STA_SCANNING 

WiFi is in STA-only mode and currently scanning for APs.

WIFI_COMPONENT_STATE_STA_CONNECTING 

WiFi is in STA(+AP) mode and currently connecting to an AP.

WIFI_COMPONENT_STATE_STA_CONNECTING_2 

WiFi is in STA(+AP) mode and currently connecting to an AP a second time.

This is required because for some reason ESPs don't like to connect to WiFi APs directly after a scan.

WIFI_COMPONENT_STATE_STA_CONNECTED 

WiFi is in STA(+AP) mode and successfully connected.

WIFI_COMPONENT_STATE_AP 

WiFi is in AP-only mode and internal AP is already enabled.

Definition at line 65 of file wifi_component.h.

◆ WiFiPowerSaveMode

Enumerator
WIFI_POWER_SAVE_NONE 
WIFI_POWER_SAVE_LIGHT 
WIFI_POWER_SAVE_HIGH 

Definition at line 195 of file wifi_component.h.

◆ WiFiSTAConnectStatus

Enumerator
IDLE 
CONNECTING 
CONNECTED 
ERROR_NETWORK_NOT_FOUND 
ERROR_CONNECT_FAILED 

Definition at line 88 of file wifi_component.h.

Function Documentation

◆ eagle_lwip_getif()

struct netif* esphome::wifi::eagle_lwip_getif ( int  netif_index)

◆ event_handler()

void esphome::wifi::event_handler ( void *  arg,
esp_event_base_t  event_base,
int32_t  event_id,
void *  event_data 
)

Definition at line 81 of file wifi_component_esp_idf.cpp.

◆ format_ip4_addr()

std::string esphome::wifi::format_ip4_addr ( const esphome_ip4_addr_t ip)

Definition at line 388 of file wifi_component_esp32_arduino.cpp.

◆ format_ip6_addr()

std::string esphome::wifi::format_ip6_addr ( const esp_ip6_addr_t &  ip)

Definition at line 583 of file wifi_component_esp_idf.cpp.

◆ format_ip_addr() [1/2]

std::string esphome::wifi::format_ip_addr ( struct ipv4_addr  ip)

Definition at line 392 of file wifi_component_esp8266.cpp.

◆ format_ip_addr() [2/2]

std::string esphome::wifi::format_ip_addr ( struct ip_addr  ip)

Definition at line 399 of file wifi_component_esp8266.cpp.

◆ get_auth_mode_str()

const char * esphome::wifi::get_auth_mode_str ( uint8_t  mode)

Definition at line 361 of file wifi_component_esp32_arduino.cpp.

◆ get_disconnect_reason_str()

const char * esphome::wifi::get_disconnect_reason_str ( uint8_t  reason)

Definition at line 408 of file wifi_component_esp32_arduino.cpp.

◆ get_op_mode_str()

const char * esphome::wifi::get_op_mode_str ( uint8_t  mode)

Definition at line 394 of file wifi_component_esp32_arduino.cpp.

◆ get_signal_bars()

const LogString* esphome::wifi::get_signal_bars ( int8_t  rssi)

Definition at line 382 of file wifi_component.cpp.

◆ netif_set_addr()

void esphome::wifi::netif_set_addr ( struct netif *  netif,
const ip4_addr_t ip,
const ip4_addr_t netmask,
const ip4_addr_t gw 
)

Variable Documentation

◆ global_wifi_component

WiFiComponent * esphome::wifi::global_wifi_component

Definition at line 856 of file wifi_component.cpp.

◆ PACKED

struct esphome::wifi::SavedWifiFastConnectSettings esphome::wifi::PACKED