7#include <user_interface.h>
11#ifdef USE_WIFI_WPA2_EAP
12#include <wpa2_enterprise.h>
20#include "lwip/apps/sntp.h"
21#include "lwip/netif.h"
23#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(3, 0, 0)
24#include "LwipDhcpServer.h"
25#if USE_ARDUINO_VERSION_CODE < VERSION_CODE(3, 1, 0)
26#include <ESP8266WiFi.h>
27#include "ESP8266WiFiAP.h"
28#define wifi_softap_set_dhcps_lease(lease) dhcpSoftAP.set_dhcps_lease(lease)
29#define wifi_softap_set_dhcps_lease_time(time) dhcpSoftAP.set_dhcps_lease_time(time)
30#define wifi_softap_set_dhcps_offer_option(offer, mode) dhcpSoftAP.set_dhcps_offer_option(offer, mode)
43static const char *
const TAG =
"wifi_esp8266";
45static bool s_sta_connected =
false;
46static bool s_sta_got_ip =
false;
47static bool s_sta_connect_not_found =
false;
48static bool s_sta_connect_error =
false;
49static bool s_sta_connecting =
false;
52 uint8_t current_mode = wifi_get_opmode();
53 bool current_sta = current_mode & 0b01;
54 bool current_ap = current_mode & 0b10;
55 bool target_sta = sta.
value_or(current_sta);
56 bool target_ap = ap.
value_or(current_ap);
57 if (current_sta == target_sta && current_ap == target_ap)
60 if (target_sta && !current_sta) {
61 ESP_LOGV(TAG,
"Enabling STA");
62 }
else if (!target_sta && current_sta) {
63 ESP_LOGV(TAG,
"Disabling STA");
66 wifi_station_dhcpc_stop();
68 if (target_ap && !current_ap) {
69 ESP_LOGV(TAG,
"Enabling AP");
70 }
else if (!target_ap && current_ap) {
71 ESP_LOGV(TAG,
"Disabling AP");
74 ETS_UART_INTR_DISABLE();
80 bool ret = wifi_set_opmode_current(
mode);
81 ETS_UART_INTR_ENABLE();
84 ESP_LOGW(TAG,
"Set mode failed");
93 sleep_type_t power_save;
96 power_save = LIGHT_SLEEP_T;
99 power_save = MODEM_SLEEP_T;
103 power_save = NONE_SLEEP_T;
106 wifi_fpm_auto_sleep_set_in_null_mode(1);
107 bool success = wifi_set_sleep_type(power_save);
108#ifdef USE_WIFI_LISTENERS
118#if LWIP_VERSION_MAJOR != 1
135 enum dhcp_status dhcp_status = wifi_station_dhcpc_status();
140 sntp_servermode_dhcp(
false);
143 if (dhcp_status != DHCP_STARTED) {
144 bool ret = wifi_station_dhcpc_start();
146 ESP_LOGV(TAG,
"Starting DHCP client failed");
155#if LWIP_VERSION_MAJOR != 1
159 wifi_get_ip_info(STATION_IF, &previp);
162 struct ip_info info {};
163 info.ip = manual_ip->static_ip;
164 info.gw = manual_ip->gateway;
165 info.netmask = manual_ip->subnet;
167 if (dhcp_status == DHCP_STARTED) {
168 bool dhcp_stop_ret = wifi_station_dhcpc_stop();
169 if (!dhcp_stop_ret) {
170 ESP_LOGV(TAG,
"Stopping DHCP client failed");
174 bool wifi_set_info_ret = wifi_set_ip_info(STATION_IF, &info);
175 if (!wifi_set_info_ret) {
176 ESP_LOGV(TAG,
"Set manual IP info failed");
181 if (manual_ip->dns1.is_set()) {
182 dns = manual_ip->dns1;
183 dns_setserver(0, &dns);
185 if (manual_ip->dns2.is_set()) {
186 dns = manual_ip->dns2;
187 dns_setserver(1, &dns);
190#if LWIP_VERSION_MAJOR != 1
193 if (previp.ip.addr != 0 && previp.ip.addr != info.ip.addr) {
195 reinterpret_cast<const ip4_addr_t *
>(&info.netmask),
reinterpret_cast<const ip4_addr_t *
>(&info.gw));
206 for (
auto &addr : addrList) {
207 addresses[index++] = addr.ipFromNetifNum();
213 bool ret = wifi_station_set_hostname(
const_cast<char *
>(hostname.c_str()));
215 ESP_LOGV(TAG,
"Set hostname failed");
219 for (netif *intf = netif_list; intf; intf = intf->next) {
221#if LWIP_VERSION_MAJOR == 1
222 intf->hostname = (
char *) wifi_station_get_hostname();
224 intf->hostname = wifi_station_get_hostname();
226 if (netif_dhcp_data(intf) !=
nullptr) {
228 err_t lwipret = dhcp_renew(intf);
229 if (lwipret != ERR_OK) {
230 ESP_LOGW(TAG,
"wifi_apply_hostname_(%s): lwIP error %d on interface %c%c (index %d)", intf->hostname,
231 (
int) lwipret, intf->name[0], intf->name[1], intf->num);
247 struct station_config conf {};
248 memset(&conf, 0,
sizeof(conf));
249 if (ap.
get_ssid().size() >
sizeof(conf.ssid)) {
250 ESP_LOGE(TAG,
"SSID too long");
254 ESP_LOGE(TAG,
"Password too long");
257 memcpy(
reinterpret_cast<char *
>(conf.ssid), ap.
get_ssid().c_str(), ap.
get_ssid().size());
262 memcpy(conf.bssid, ap.
get_bssid().data(), 6);
267#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 4, 0)
269 conf.threshold.authmode = AUTH_OPEN;
275 conf.threshold.authmode = AUTH_WPA_PSK;
279 conf.threshold.authmode = AUTH_WPA2_PSK;
283 conf.threshold.rssi = -127;
286 ETS_UART_INTR_DISABLE();
287 bool ret = wifi_station_set_config_current(&conf);
288 ETS_UART_INTR_ENABLE();
291 ESP_LOGV(TAG,
"Set Station config failed");
295#ifdef USE_WIFI_MANUAL_IP
306#ifdef USE_WIFI_WPA2_EAP
307 if (ap.
get_eap().has_value()) {
310 ret = wifi_station_set_enterprise_identity((uint8_t *) eap.
identity.c_str(), eap.
identity.length());
312 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_identity failed: %d", ret);
314 int ca_cert_len = strlen(eap.
ca_cert);
318 ret = wifi_station_set_enterprise_ca_cert((uint8_t *) eap.
ca_cert, ca_cert_len + 1);
320 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_ca_cert failed: %d", ret);
325 if (client_cert_len && client_key_len) {
327 ret = wifi_station_set_enterprise_cert_key((uint8_t *) eap.
client_cert, client_cert_len + 1,
328 (uint8_t *) eap.
client_key, client_key_len + 1,
331 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_cert_key failed: %d", ret);
335 ret = wifi_station_set_enterprise_username((uint8_t *) eap.
username.c_str(), eap.
username.length());
337 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_username failed: %d", ret);
339 ret = wifi_station_set_enterprise_password((uint8_t *) eap.
password.c_str(), eap.
password.length());
341 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_password failed: %d", ret);
344 ret = wifi_station_set_wpa2_enterprise_auth(
true);
346 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_enable failed: %d", ret);
355 s_sta_connecting =
true;
356 s_sta_connected =
false;
357 s_sta_got_ip =
false;
358 s_sta_connect_error =
false;
359 s_sta_connect_not_found =
false;
361 ETS_UART_INTR_DISABLE();
362 ret = wifi_station_connect();
363 ETS_UART_INTR_ENABLE();
365 ESP_LOGV(TAG,
"wifi_station_connect failed");
370 bool connected =
false;
372 uint8_t ipv6_addr_count = 0;
373 for (
auto addr : addrList) {
374 ESP_LOGV(TAG,
"Address %s", addr.toString().c_str());
380 connected = (ipv6_addr_count >= USE_NETWORK_MIN_IPV6_ADDR_COUNT);
387 ESP_LOGV(TAG,
"wifi_set_channel failed");
395class WiFiMockClass :
public ESP8266WiFiGenericClass {
397 static void _event_callback(
void *event) { ESP8266WiFiGenericClass::_eventCallback(event); }
403 return LOG_STR(
"OPEN");
405 return LOG_STR(
"WEP");
407 return LOG_STR(
"WPA PSK");
409 return LOG_STR(
"WPA2 PSK");
410 case AUTH_WPA_WPA2_PSK:
411 return LOG_STR(
"WPA/WPA2 PSK");
413 return LOG_STR(
"UNKNOWN");
419 sprintf(buf,
"%u.%u.%u.%u", uint8_t(ip.addr >> 0), uint8_t(ip.addr >> 8), uint8_t(ip.addr >> 16),
420 uint8_t(ip.addr >> 24));
426 sprintf(buf,
"%u.%u.%u.%u", uint8_t(ip.addr >> 0), uint8_t(ip.addr >> 8), uint8_t(ip.addr >> 16),
427 uint8_t(ip.addr >> 24));
434 return LOG_STR(
"OFF");
436 return LOG_STR(
"STA");
438 return LOG_STR(
"AP");
440 return LOG_STR(
"AP+STA");
442 return LOG_STR(
"UNKNOWN");
451 if (reason <= REASON_CIPHER_SUITE_REJECTED) {
453 case REASON_AUTH_EXPIRE:
454 return LOG_STR(
"Auth Expired");
455 case REASON_AUTH_LEAVE:
456 return LOG_STR(
"Auth Leave");
457 case REASON_ASSOC_EXPIRE:
458 return LOG_STR(
"Association Expired");
459 case REASON_ASSOC_TOOMANY:
460 return LOG_STR(
"Too Many Associations");
461 case REASON_NOT_AUTHED:
462 return LOG_STR(
"Not Authenticated");
463 case REASON_NOT_ASSOCED:
464 return LOG_STR(
"Not Associated");
465 case REASON_ASSOC_LEAVE:
466 return LOG_STR(
"Association Leave");
467 case REASON_ASSOC_NOT_AUTHED:
468 return LOG_STR(
"Association not Authenticated");
469 case REASON_DISASSOC_PWRCAP_BAD:
470 return LOG_STR(
"Disassociate Power Cap Bad");
471 case REASON_DISASSOC_SUPCHAN_BAD:
472 return LOG_STR(
"Disassociate Supported Channel Bad");
473 case REASON_IE_INVALID:
474 return LOG_STR(
"IE Invalid");
475 case REASON_MIC_FAILURE:
476 return LOG_STR(
"Mic Failure");
477 case REASON_4WAY_HANDSHAKE_TIMEOUT:
478 return LOG_STR(
"4-Way Handshake Timeout");
479 case REASON_GROUP_KEY_UPDATE_TIMEOUT:
480 return LOG_STR(
"Group Key Update Timeout");
481 case REASON_IE_IN_4WAY_DIFFERS:
482 return LOG_STR(
"IE In 4-Way Handshake Differs");
483 case REASON_GROUP_CIPHER_INVALID:
484 return LOG_STR(
"Group Cipher Invalid");
485 case REASON_PAIRWISE_CIPHER_INVALID:
486 return LOG_STR(
"Pairwise Cipher Invalid");
487 case REASON_AKMP_INVALID:
488 return LOG_STR(
"AKMP Invalid");
489 case REASON_UNSUPP_RSN_IE_VERSION:
490 return LOG_STR(
"Unsupported RSN IE version");
491 case REASON_INVALID_RSN_IE_CAP:
492 return LOG_STR(
"Invalid RSN IE Cap");
493 case REASON_802_1X_AUTH_FAILED:
494 return LOG_STR(
"802.1x Authentication Failed");
495 case REASON_CIPHER_SUITE_REJECTED:
496 return LOG_STR(
"Cipher Suite Rejected");
501 case REASON_BEACON_TIMEOUT:
502 return LOG_STR(
"Beacon Timeout");
503 case REASON_NO_AP_FOUND:
504 return LOG_STR(
"AP Not Found");
505 case REASON_AUTH_FAIL:
506 return LOG_STR(
"Authentication Failed");
507 case REASON_ASSOC_FAIL:
508 return LOG_STR(
"Association Failed");
509 case REASON_HANDSHAKE_TIMEOUT:
510 return LOG_STR(
"Handshake Failed");
511 case REASON_UNSPECIFIED:
513 return LOG_STR(
"Unspecified");
518 switch (event->event) {
519 case EVENT_STAMODE_CONNECTED: {
520 auto it =
event->event_info.connected;
522 memcpy(buf, it.ssid, it.ssid_len);
523 buf[it.ssid_len] =
'\0';
526 s_sta_connected =
true;
527#ifdef USE_WIFI_LISTENERS
529 listener->on_wifi_connect_state(
StringRef(buf, it.ssid_len), it.bssid);
532#ifdef USE_WIFI_MANUAL_IP
544 case EVENT_STAMODE_DISCONNECTED: {
545 auto it =
event->event_info.disconnected;
547 memcpy(buf, it.ssid, it.ssid_len);
548 buf[it.ssid_len] =
'\0';
549 if (it.reason == REASON_NO_AP_FOUND) {
550 ESP_LOGW(TAG,
"Disconnected ssid='%s' reason='Probe Request Unsuccessful'", buf);
551 s_sta_connect_not_found =
true;
555 ESP_LOGW(TAG,
"Disconnected ssid='%s' bssid=" LOG_SECRET(
"%s")
" reason='%s'", buf, bssid_s,
557 s_sta_connect_error =
true;
559 s_sta_connected =
false;
560 s_sta_connecting =
false;
561#ifdef USE_WIFI_LISTENERS
562 static constexpr uint8_t EMPTY_BSSID[6] = {};
564 listener->on_wifi_connect_state(
StringRef(), EMPTY_BSSID);
569 case EVENT_STAMODE_AUTHMODE_CHANGE: {
570 auto it =
event->event_info.auth_change;
571 ESP_LOGV(TAG,
"Changed Authmode old=%s new=%s", LOG_STR_ARG(
get_auth_mode_str(it.old_mode)),
575 if (it.old_mode != AUTH_OPEN && it.new_mode == AUTH_OPEN) {
576 ESP_LOGW(TAG,
"Potential Authmode downgrade detected, disconnecting");
579 wifi_station_disconnect();
584 case EVENT_STAMODE_GOT_IP: {
585 auto it =
event->event_info.got_ip;
589#ifdef USE_WIFI_LISTENERS
597 case EVENT_STAMODE_DHCP_TIMEOUT: {
598 ESP_LOGW(TAG,
"DHCP request timeout");
601 case EVENT_SOFTAPMODE_STACONNECTED: {
602 auto it =
event->event_info.sta_connected;
606 case EVENT_SOFTAPMODE_STADISCONNECTED: {
607 auto it =
event->event_info.sta_disconnected;
611 case EVENT_SOFTAPMODE_PROBEREQRECVED: {
612 auto it =
event->event_info.ap_probereqrecved;
616#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 4, 0)
617 case EVENT_OPMODE_CHANGED: {
618 auto it =
event->event_info.opmode_changed;
619 ESP_LOGV(TAG,
"Changed Mode old=%s new=%s", LOG_STR_ARG(
get_op_mode_str(it.old_opmode)),
623 case EVENT_SOFTAPMODE_DISTRIBUTE_STA_IP: {
624 auto it =
event->event_info.distribute_sta_ip;
634 if (event->event == EVENT_STAMODE_DISCONNECTED) {
638 WiFiMockClass::_event_callback(event);
642 uint8_t
val =
static_cast<uint8_t
>(output_power * 4);
643 system_phy_set_max_tpw(
val);
651 ETS_UART_INTR_DISABLE();
652 ret1 = wifi_station_set_auto_connect(0);
653 ret2 = wifi_station_set_reconnect_policy(
false);
654 ETS_UART_INTR_ENABLE();
656 if (!ret1 || !ret2) {
657 ESP_LOGV(TAG,
"Disabling Auto-Connect failed");
672 station_status_t
status = wifi_station_get_connect_status();
676 case STATION_NO_AP_FOUND:
679 case STATION_CONNECT_FAIL:
680 case STATION_WRONG_PASSWORD:
682 case STATION_CONNECTING:
690 static bool first_scan =
false;
696 struct scan_config config {};
697 memset(&config, 0,
sizeof(config));
698 config.ssid =
nullptr;
699 config.bssid =
nullptr;
701 config.show_hidden = 1;
702#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 4, 0)
703 config.scan_type = passive ? WIFI_SCAN_TYPE_PASSIVE : WIFI_SCAN_TYPE_ACTIVE;
706 config.scan_time.passive = 200;
708 config.scan_time.active.min = 100;
709 config.scan_time.active.max = 200;
713 config.scan_time.passive = 500;
715 config.scan_time.active.min = 400;
716 config.scan_time.active.max = 500;
723 ESP_LOGV(TAG,
"wifi_station_scan failed");
732 if (wifi_get_opmode() & WIFI_STA)
733 ret = wifi_station_disconnect();
734 station_config conf{};
735 memset(&conf, 0,
sizeof(conf));
736 ETS_UART_INTR_DISABLE();
737 wifi_station_set_config_current(&conf);
738 ETS_UART_INTR_ENABLE();
749 ESP_LOGV(TAG,
"Scan failed: %d",
status);
755 auto *head =
reinterpret_cast<bss_info *
>(arg);
757 for (bss_info *it = head; it !=
nullptr; it = STAILQ_NEXT(it, next)) {
762 for (bss_info *it = head; it !=
nullptr; it = STAILQ_NEXT(it, next)) {
764 bssid_t{it->bssid[0], it->bssid[1], it->bssid[2], it->bssid[3], it->bssid[4], it->bssid[5]},
765 std::string(
reinterpret_cast<char *
>(it->ssid), it->ssid_len), it->channel, it->rssi, it->authmode != AUTH_OPEN,
769#ifdef USE_WIFI_LISTENERS
782 struct ip_info info {};
784 info.ip = manual_ip->static_ip;
785 info.gw = manual_ip->gateway;
786 info.netmask = manual_ip->subnet;
793 if (wifi_softap_dhcps_status() == DHCP_STARTED) {
794 if (!wifi_softap_dhcps_stop()) {
795 ESP_LOGW(TAG,
"Stopping DHCP server failed");
799 if (!wifi_set_ip_info(SOFTAP_IF, &info)) {
800 ESP_LOGE(TAG,
"Set SoftAP info failed");
804#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(3, 0, 0) && USE_ARDUINO_VERSION_CODE < VERSION_CODE(3, 1, 0)
805 dhcpSoftAP.begin(&info);
808 struct dhcps_lease lease {};
812 lease.start_ip = start_address;
813 ESP_LOGV(TAG,
"DHCP server IP lease start: %s", start_address.
str().c_str());
815 lease.end_ip = start_address;
816 ESP_LOGV(TAG,
"DHCP server IP lease end: %s", start_address.
str().c_str());
817 if (!wifi_softap_set_dhcps_lease(&lease)) {
818 ESP_LOGE(TAG,
"Set SoftAP DHCP lease failed");
823 if (!wifi_softap_set_dhcps_lease_time(1440)) {
824 ESP_LOGE(TAG,
"Set SoftAP DHCP lease time failed");
828#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(3, 1, 0)
829 ESP8266WiFiClass::softAPDhcpServer().setRouter(
true);
833 if (!wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &
mode)) {
834 ESP_LOGE(TAG,
"wifi_softap_set_dhcps_offer_option failed");
839 if (!wifi_softap_dhcps_start()) {
840 ESP_LOGE(TAG,
"Starting SoftAP DHCPS failed");
852 struct softap_config conf {};
853 if (ap.
get_ssid().size() >
sizeof(conf.ssid)) {
854 ESP_LOGE(TAG,
"AP SSID too long");
857 memcpy(
reinterpret_cast<char *
>(conf.ssid), ap.
get_ssid().c_str(), ap.
get_ssid().size());
858 conf.ssid_len =
static_cast<uint8
>(ap.
get_ssid().size());
861 conf.max_connection = 5;
862 conf.beacon_interval = 100;
865 conf.authmode = AUTH_OPEN;
868 conf.authmode = AUTH_WPA2_PSK;
870 ESP_LOGE(TAG,
"AP password too long");
876 ETS_UART_INTR_DISABLE();
877 bool ret = wifi_softap_set_config_current(&conf);
878 ETS_UART_INTR_ENABLE();
881 ESP_LOGV(TAG,
"wifi_softap_set_config_current failed");
885#ifdef USE_WIFI_MANUAL_IP
887 ESP_LOGV(TAG,
"wifi_ap_ip_config_ failed");
892 ESP_LOGV(TAG,
"wifi_ap_ip_config_ failed");
901 struct ip_info ip {};
902 wifi_get_ip_info(SOFTAP_IF, &ip);
909 struct station_config conf {};
910 if (wifi_station_get_config(&conf)) {
911 std::copy_n(conf.bssid, bssid.size(), bssid.begin());
917 struct station_config conf {};
918 if (!wifi_station_get_config(&conf)) {
920 return buffer.data();
923 size_t len = strnlen(
reinterpret_cast<const char *
>(conf.ssid),
sizeof(conf.ssid));
924 memcpy(buffer.data(), conf.ssid,
len);
926 return buffer.data();
929 if (WiFi.status() != WL_CONNECTED)
930 return WIFI_RSSI_DISCONNECTED;
931 int8_t rssi = WiFi.RSSI();
933 return rssi >= 31 ? WIFI_RSSI_DISCONNECTED : rssi;
BedjetMode mode
BedJet operating mode.
const std::string & get_name() const
Get the name of this Application set by pre_setup().
StringRef is a reference to a string owned by something else.
value_type value_or(U const &v) const
uint8_t get_channel() const
const std::string & get_ssid() const
const optional< EAPAuth > & get_eap() const
const std::string & get_password() const
const optional< ManualIP > & get_manual_ip() const
const bssid_t & get_bssid() const
void wifi_scan_done_callback_(void *arg, STATUS status)
bool error_from_callback_
bool wifi_apply_power_save_()
WiFiPowerSaveMode power_save_
std::vector< WiFiIPStateListener * > ip_state_listeners_
const WiFiAP * get_selected_sta_() const
std::vector< WiFiScanResultsListener * > scan_results_listeners_
wifi_scan_vector_t< WiFiScanResult > scan_result_
bool wifi_sta_ip_config_(const optional< ManualIP > &manual_ip)
network::IPAddress get_dns_address(int num)
static void wifi_event_callback(System_Event_t *event)
bool wifi_start_ap_(const WiFiAP &ap)
int32_t get_wifi_channel()
const char * wifi_ssid_to(std::span< char, SSID_BUFFER_SIZE > buffer)
Write SSID to buffer without heap allocation.
network::IPAddress wifi_subnet_mask_()
network::IPAddress wifi_soft_ap_ip()
network::IPAddress wifi_gateway_ip_()
static void s_wifi_scan_done_callback(void *arg, STATUS status)
network::IPAddress wifi_dns_ip_(int num)
bool wifi_apply_hostname_()
bool wifi_sta_pre_setup_()
bool wifi_ap_ip_config_(const optional< ManualIP > &manual_ip)
WifiMinAuthMode min_auth_mode_
bool wifi_apply_output_power_(float output_power)
WiFiSTAConnectStatus wifi_sta_connect_status_()
bool wifi_sta_connect_(const WiFiAP &ap)
bool wifi_mode_(optional< bool > sta, optional< bool > ap)
network::IPAddresses wifi_sta_ip_addresses()
bool wifi_scan_start_(bool passive)
void wifi_scan_done_callback_()
std::vector< WiFiConnectStateListener * > connect_state_listeners_
std::vector< WiFiPowerSaveListener * > power_save_listeners_
std::array< IPAddress, 5 > IPAddresses
std::array< uint8_t, 6 > bssid_t
const LogString * get_auth_mode_str(uint8_t mode)
const LogString * get_disconnect_reason_str(uint8_t reason)
@ WIFI_MIN_AUTH_MODE_WPA2
@ WIFI_MIN_AUTH_MODE_WPA3
struct netif * eagle_lwip_getif(int netif_index)
std::string format_ip_addr(struct ipv4_addr ip)
@ ERROR_NETWORK_NOT_FOUND
void netif_set_addr(struct netif *netif, const ip4_addr_t *ip, const ip4_addr_t *netmask, const ip4_addr_t *gw)
WiFiComponent * global_wifi_component
const LogString * get_op_mode_str(uint8_t mode)
void format_mac_addr_upper(const uint8_t *mac, char *output)
Format MAC address as XX:XX:XX:XX:XX:XX (uppercase, colon separators)
std::string format_mac_address_pretty(const uint8_t *mac)
void IRAM_ATTR HOT delay(uint32_t ms)
Application App
Global storage of Application pointer - only one Application can exist.