7 #include <user_interface.h> 11 #ifdef USE_WIFI_WPA2_EAP 12 #include <wpa2_enterprise.h> 18 #include "lwip/dhcp.h" 19 #include "lwip/init.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) 44 static const char *
const TAG =
"wifi_esp8266";
46 static bool s_sta_connected =
false;
47 static bool s_sta_got_ip =
false;
48 static bool s_sta_connect_not_found =
false;
49 static bool s_sta_connect_error =
false;
50 static bool s_sta_connecting =
false;
53 uint8_t current_mode = wifi_get_opmode();
54 bool current_sta = current_mode & 0b01;
55 bool current_ap = current_mode & 0b10;
56 bool target_sta = sta.value_or(current_sta);
57 bool target_ap = ap.value_or(current_ap);
58 if (current_sta == target_sta && current_ap == target_ap)
61 if (target_sta && !current_sta) {
62 ESP_LOGV(TAG,
"Enabling STA.");
63 }
else if (!target_sta && current_sta) {
64 ESP_LOGV(TAG,
"Disabling STA.");
67 wifi_station_dhcpc_stop();
69 if (target_ap && !current_ap) {
70 ESP_LOGV(TAG,
"Enabling AP.");
71 }
else if (!target_ap && current_ap) {
72 ESP_LOGV(TAG,
"Disabling AP.");
75 ETS_UART_INTR_DISABLE();
81 bool ret = wifi_set_opmode_current(mode);
82 ETS_UART_INTR_ENABLE();
85 ESP_LOGW(TAG,
"Setting WiFi mode failed!");
91 sleep_type_t power_save;
94 power_save = LIGHT_SLEEP_T;
97 power_save = MODEM_SLEEP_T;
101 power_save = NONE_SLEEP_T;
104 wifi_fpm_auto_sleep_set_in_null_mode(1);
105 return wifi_set_sleep_type(power_save);
108 #if LWIP_VERSION_MAJOR != 1 113 #undef netif_set_addr // need to call lwIP-v1.4 netif_set_addr() 125 enum dhcp_status dhcp_status = wifi_station_dhcpc_status();
126 if (!manual_ip.has_value()) {
130 sntp_servermode_dhcp(
false);
133 if (dhcp_status != DHCP_STARTED) {
134 bool ret = wifi_station_dhcpc_start();
136 ESP_LOGV(TAG,
"Starting DHCP client failed!");
145 #if LWIP_VERSION_MAJOR != 1 149 wifi_get_ip_info(STATION_IF, &previp);
152 struct ip_info info {};
153 info.ip = manual_ip->static_ip;
154 info.gw = manual_ip->gateway;
155 info.netmask = manual_ip->subnet;
157 if (dhcp_status == DHCP_STARTED) {
158 bool dhcp_stop_ret = wifi_station_dhcpc_stop();
159 if (!dhcp_stop_ret) {
160 ESP_LOGV(TAG,
"Stopping DHCP client failed!");
164 bool wifi_set_info_ret = wifi_set_ip_info(STATION_IF, &info);
165 if (!wifi_set_info_ret) {
166 ESP_LOGV(TAG,
"Setting manual IP info failed!");
171 if (manual_ip->dns1.is_set()) {
172 dns = manual_ip->dns1;
173 dns_setserver(0, &dns);
175 if (manual_ip->dns2.is_set()) {
176 dns = manual_ip->dns2;
177 dns_setserver(1, &dns);
180 #if LWIP_VERSION_MAJOR != 1 183 if (previp.ip.addr != 0 && previp.ip.addr != info.ip.addr) {
185 reinterpret_cast<const ip4_addr_t *>(&info.netmask), reinterpret_cast<const ip4_addr_t *>(&info.gw));
196 for (
auto &addr : addrList) {
197 addresses[index++] = addr.ipFromNetifNum();
203 bool ret = wifi_station_set_hostname(const_cast<char *>(hostname.c_str()));
205 ESP_LOGV(TAG,
"Setting WiFi Hostname failed!");
209 for (netif *intf = netif_list; intf; intf = intf->next) {
211 #if LWIP_VERSION_MAJOR == 1 212 intf->hostname = (
char *) wifi_station_get_hostname();
214 intf->hostname = wifi_station_get_hostname();
216 if (netif_dhcp_data(intf) !=
nullptr) {
218 err_t lwipret = dhcp_renew(intf);
219 if (lwipret != ERR_OK) {
220 ESP_LOGW(TAG,
"wifi_apply_hostname_(%s): lwIP error %d on interface %c%c (index %d)", intf->hostname,
221 (
int) lwipret, intf->name[0], intf->name[1], intf->num);
237 struct station_config conf {};
238 memset(&conf, 0,
sizeof(conf));
239 if (ap.get_ssid().size() >
sizeof(conf.ssid)) {
240 ESP_LOGE(TAG,
"SSID is too long");
243 if (ap.get_password().size() >
sizeof(conf.password)) {
244 ESP_LOGE(TAG,
"password is too long");
247 memcpy(reinterpret_cast<char *>(conf.ssid), ap.get_ssid().c_str(), ap.get_ssid().size());
248 memcpy(reinterpret_cast<char *>(conf.password), ap.get_password().c_str(), ap.get_password().size());
250 if (ap.get_bssid().has_value()) {
252 memcpy(conf.bssid, ap.get_bssid()->data(), 6);
257 #if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 4, 0) 258 if (ap.get_password().empty()) {
259 conf.threshold.authmode = AUTH_OPEN;
262 conf.threshold.authmode = AUTH_WPA_PSK;
264 conf.threshold.rssi = -127;
267 ETS_UART_INTR_DISABLE();
268 bool ret = wifi_station_set_config_current(&conf);
269 ETS_UART_INTR_ENABLE();
272 ESP_LOGV(TAG,
"Setting WiFi Station config failed!");
281 #ifdef USE_WIFI_WPA2_EAP 282 if (ap.get_eap().has_value()) {
284 EAPAuth eap = ap.get_eap().value();
285 ret = wifi_station_set_enterprise_identity((uint8_t *) eap.identity.c_str(), eap.identity.length());
287 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_identity failed! %d", ret);
289 int ca_cert_len = strlen(eap.ca_cert);
290 int client_cert_len = strlen(eap.client_cert);
291 int client_key_len = strlen(eap.client_key);
293 ret = wifi_station_set_enterprise_ca_cert((uint8_t *) eap.ca_cert, ca_cert_len + 1);
295 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_ca_cert failed! %d", ret);
300 if (client_cert_len && client_key_len) {
302 ret = wifi_station_set_enterprise_cert_key((uint8_t *) eap.client_cert, client_cert_len + 1,
303 (uint8_t *) eap.client_key, client_key_len + 1,
304 (uint8_t *) eap.password.c_str(), strlen(eap.password.c_str()));
306 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_cert_key failed! %d", ret);
310 ret = wifi_station_set_enterprise_username((uint8_t *) eap.username.c_str(), eap.username.length());
312 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_username failed! %d", ret);
314 ret = wifi_station_set_enterprise_password((uint8_t *) eap.password.c_str(), eap.password.length());
316 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_set_password failed! %d", ret);
319 ret = wifi_station_set_wpa2_enterprise_auth(
true);
321 ESP_LOGV(TAG,
"esp_wifi_sta_wpa2_ent_enable failed! %d", ret);
324 #endif // USE_WIFI_WPA2_EAP 330 s_sta_connecting =
true;
331 s_sta_connected =
false;
332 s_sta_got_ip =
false;
333 s_sta_connect_error =
false;
334 s_sta_connect_not_found =
false;
336 ETS_UART_INTR_DISABLE();
337 ret = wifi_station_connect();
338 ETS_UART_INTR_ENABLE();
340 ESP_LOGV(TAG,
"wifi_station_connect failed!");
345 bool connected =
false;
347 uint8_t ipv6_addr_count = 0;
348 for (
auto addr : addrList) {
349 ESP_LOGV(TAG,
"Address %s", addr.toString().c_str());
355 connected = (ipv6_addr_count >= USE_NETWORK_MIN_IPV6_ADDR_COUNT);
359 if (ap.get_channel().has_value()) {
360 ret = wifi_set_channel(*ap.get_channel());
362 ESP_LOGV(TAG,
"wifi_set_channel failed!");
370 class WiFiMockClass :
public ESP8266WiFiGenericClass {
372 static void _event_callback(
void *event) { ESP8266WiFiGenericClass::_eventCallback(event); }
378 return LOG_STR(
"OPEN");
380 return LOG_STR(
"WEP");
382 return LOG_STR(
"WPA PSK");
384 return LOG_STR(
"WPA2 PSK");
385 case AUTH_WPA_WPA2_PSK:
386 return LOG_STR(
"WPA/WPA2 PSK");
388 return LOG_STR(
"UNKNOWN");
394 sprintf(buf,
"%u.%u.%u.%u", uint8_t(ip.addr >> 0), uint8_t(ip.addr >> 8), uint8_t(ip.addr >> 16),
395 uint8_t(ip.addr >> 24));
401 sprintf(buf,
"%u.%u.%u.%u", uint8_t(ip.addr >> 0), uint8_t(ip.addr >> 8), uint8_t(ip.addr >> 16),
402 uint8_t(ip.addr >> 24));
409 return LOG_STR(
"OFF");
411 return LOG_STR(
"STA");
413 return LOG_STR(
"AP");
415 return LOG_STR(
"AP+STA");
417 return LOG_STR(
"UNKNOWN");
426 if (reason <= REASON_CIPHER_SUITE_REJECTED) {
428 case REASON_AUTH_EXPIRE:
429 return LOG_STR(
"Auth Expired");
430 case REASON_AUTH_LEAVE:
431 return LOG_STR(
"Auth Leave");
432 case REASON_ASSOC_EXPIRE:
433 return LOG_STR(
"Association Expired");
434 case REASON_ASSOC_TOOMANY:
435 return LOG_STR(
"Too Many Associations");
436 case REASON_NOT_AUTHED:
437 return LOG_STR(
"Not Authenticated");
438 case REASON_NOT_ASSOCED:
439 return LOG_STR(
"Not Associated");
440 case REASON_ASSOC_LEAVE:
441 return LOG_STR(
"Association Leave");
442 case REASON_ASSOC_NOT_AUTHED:
443 return LOG_STR(
"Association not Authenticated");
444 case REASON_DISASSOC_PWRCAP_BAD:
445 return LOG_STR(
"Disassociate Power Cap Bad");
446 case REASON_DISASSOC_SUPCHAN_BAD:
447 return LOG_STR(
"Disassociate Supported Channel Bad");
448 case REASON_IE_INVALID:
449 return LOG_STR(
"IE Invalid");
450 case REASON_MIC_FAILURE:
451 return LOG_STR(
"Mic Failure");
452 case REASON_4WAY_HANDSHAKE_TIMEOUT:
453 return LOG_STR(
"4-Way Handshake Timeout");
454 case REASON_GROUP_KEY_UPDATE_TIMEOUT:
455 return LOG_STR(
"Group Key Update Timeout");
456 case REASON_IE_IN_4WAY_DIFFERS:
457 return LOG_STR(
"IE In 4-Way Handshake Differs");
458 case REASON_GROUP_CIPHER_INVALID:
459 return LOG_STR(
"Group Cipher Invalid");
460 case REASON_PAIRWISE_CIPHER_INVALID:
461 return LOG_STR(
"Pairwise Cipher Invalid");
462 case REASON_AKMP_INVALID:
463 return LOG_STR(
"AKMP Invalid");
464 case REASON_UNSUPP_RSN_IE_VERSION:
465 return LOG_STR(
"Unsupported RSN IE version");
466 case REASON_INVALID_RSN_IE_CAP:
467 return LOG_STR(
"Invalid RSN IE Cap");
468 case REASON_802_1X_AUTH_FAILED:
469 return LOG_STR(
"802.1x Authentication Failed");
470 case REASON_CIPHER_SUITE_REJECTED:
471 return LOG_STR(
"Cipher Suite Rejected");
476 case REASON_BEACON_TIMEOUT:
477 return LOG_STR(
"Beacon Timeout");
478 case REASON_NO_AP_FOUND:
479 return LOG_STR(
"AP Not Found");
480 case REASON_AUTH_FAIL:
481 return LOG_STR(
"Authentication Failed");
482 case REASON_ASSOC_FAIL:
483 return LOG_STR(
"Association Failed");
484 case REASON_HANDSHAKE_TIMEOUT:
485 return LOG_STR(
"Handshake Failed");
486 case REASON_UNSPECIFIED:
488 return LOG_STR(
"Unspecified");
493 switch (event->event) {
494 case EVENT_STAMODE_CONNECTED: {
495 auto it =
event->event_info.connected;
497 memcpy(buf, it.ssid, it.ssid_len);
498 buf[it.ssid_len] =
'\0';
499 ESP_LOGV(TAG,
"Event: Connected ssid='%s' bssid=%s channel=%u", buf,
format_mac_addr(it.bssid).c_str(),
501 s_sta_connected =
true;
504 case EVENT_STAMODE_DISCONNECTED: {
505 auto it =
event->event_info.disconnected;
507 memcpy(buf, it.ssid, it.ssid_len);
508 buf[it.ssid_len] =
'\0';
509 if (it.reason == REASON_NO_AP_FOUND) {
510 ESP_LOGW(TAG,
"Event: Disconnected ssid='%s' reason='Probe Request Unsuccessful'", buf);
511 s_sta_connect_not_found =
true;
513 ESP_LOGW(TAG,
"Event: Disconnected ssid='%s' bssid=" LOG_SECRET(
"%s")
" reason='%s'", buf,
515 s_sta_connect_error =
true;
517 s_sta_connected =
false;
518 s_sta_connecting =
false;
521 case EVENT_STAMODE_AUTHMODE_CHANGE: {
522 auto it =
event->event_info.auth_change;
523 ESP_LOGV(TAG,
"Event: Changed AuthMode old=%s new=%s", LOG_STR_ARG(
get_auth_mode_str(it.old_mode)),
527 if (it.old_mode != AUTH_OPEN && it.new_mode == AUTH_OPEN) {
528 ESP_LOGW(TAG,
"Potential Authmode downgrade detected, disconnecting...");
531 wifi_station_disconnect();
536 case EVENT_STAMODE_GOT_IP: {
537 auto it =
event->event_info.got_ip;
538 ESP_LOGV(TAG,
"Event: Got IP static_ip=%s gateway=%s netmask=%s",
format_ip_addr(it.ip).c_str(),
543 case EVENT_STAMODE_DHCP_TIMEOUT: {
544 ESP_LOGW(TAG,
"Event: Getting IP address timeout");
547 case EVENT_SOFTAPMODE_STACONNECTED: {
548 auto it =
event->event_info.sta_connected;
549 ESP_LOGV(TAG,
"Event: AP client connected MAC=%s aid=%u",
format_mac_addr(it.mac).c_str(), it.aid);
552 case EVENT_SOFTAPMODE_STADISCONNECTED: {
553 auto it =
event->event_info.sta_disconnected;
554 ESP_LOGV(TAG,
"Event: AP client disconnected MAC=%s aid=%u",
format_mac_addr(it.mac).c_str(), it.aid);
557 case EVENT_SOFTAPMODE_PROBEREQRECVED: {
558 auto it =
event->event_info.ap_probereqrecved;
559 ESP_LOGVV(TAG,
"Event: AP receive Probe Request MAC=%s RSSI=%d",
format_mac_addr(it.mac).c_str(), it.rssi);
562 #if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 4, 0) 563 case EVENT_OPMODE_CHANGED: {
564 auto it =
event->event_info.opmode_changed;
565 ESP_LOGV(TAG,
"Event: Changed Mode old=%s new=%s", LOG_STR_ARG(
get_op_mode_str(it.old_opmode)),
569 case EVENT_SOFTAPMODE_DISTRIBUTE_STA_IP: {
570 auto it =
event->event_info.distribute_sta_ip;
571 ESP_LOGV(TAG,
"Event: AP Distribute Station IP MAC=%s IP=%s aid=%u",
format_mac_addr(it.mac).c_str(),
580 if (event->event == EVENT_STAMODE_DISCONNECTED) {
584 WiFiMockClass::_event_callback(event);
588 uint8_t
val =
static_cast<uint8_t
>(output_power * 4);
589 system_phy_set_max_tpw(val);
597 ETS_UART_INTR_DISABLE();
598 ret1 = wifi_station_set_auto_connect(0);
599 ret2 = wifi_station_set_reconnect_policy(
false);
600 ETS_UART_INTR_ENABLE();
602 if (!ret1 || !ret2) {
603 ESP_LOGV(TAG,
"Disabling Auto-Connect failed!");
618 station_status_t
status = wifi_station_get_connect_status();
622 case STATION_NO_AP_FOUND:
625 case STATION_CONNECT_FAIL:
626 case STATION_WRONG_PASSWORD:
628 case STATION_CONNECTING:
636 static bool first_scan =
false;
642 struct scan_config config {};
643 memset(&config, 0,
sizeof(config));
644 config.ssid =
nullptr;
645 config.bssid =
nullptr;
647 config.show_hidden = 1;
648 #if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 4, 0) 649 config.scan_type = passive ? WIFI_SCAN_TYPE_PASSIVE : WIFI_SCAN_TYPE_ACTIVE;
652 config.scan_time.passive = 200;
654 config.scan_time.active.min = 100;
655 config.scan_time.active.max = 200;
659 config.scan_time.passive = 500;
661 config.scan_time.active.min = 400;
662 config.scan_time.active.max = 500;
669 ESP_LOGV(TAG,
"wifi_station_scan failed!");
678 if (wifi_get_opmode() & WIFI_STA)
679 ret = wifi_station_disconnect();
680 station_config conf{};
681 memset(&conf, 0,
sizeof(conf));
682 ETS_UART_INTR_DISABLE();
683 wifi_station_set_config_current(&conf);
684 ETS_UART_INTR_ENABLE();
695 ESP_LOGV(TAG,
"Scan failed! %d", status);
699 auto *head =
reinterpret_cast<bss_info *
>(arg);
700 for (bss_info *it = head; it !=
nullptr; it = STAILQ_NEXT(it, next)) {
701 WiFiScanResult res({it->bssid[0], it->bssid[1], it->bssid[2], it->bssid[3], it->bssid[4], it->bssid[5]},
702 std::string(reinterpret_cast<char *>(it->ssid), it->ssid_len), it->channel, it->rssi,
703 it->authmode != AUTH_OPEN, it->is_hidden != 0);
715 struct ip_info info {};
717 info.ip = manual_ip->static_ip;
718 info.gw = manual_ip->gateway;
719 info.netmask = manual_ip->subnet;
726 if (wifi_softap_dhcps_status() == DHCP_STARTED) {
727 if (!wifi_softap_dhcps_stop()) {
728 ESP_LOGW(TAG,
"Stopping DHCP server failed!");
732 if (!wifi_set_ip_info(SOFTAP_IF, &info)) {
733 ESP_LOGE(TAG,
"Setting SoftAP info failed!");
737 #if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(3, 0, 0) && USE_ARDUINO_VERSION_CODE < VERSION_CODE(3, 1, 0) 738 dhcpSoftAP.begin(&info);
741 struct dhcps_lease lease {};
745 lease.start_ip = start_address;
746 ESP_LOGV(TAG,
"DHCP server IP lease start: %s", start_address.
str().c_str());
748 lease.end_ip = start_address;
749 ESP_LOGV(TAG,
"DHCP server IP lease end: %s", start_address.str().c_str());
750 if (!wifi_softap_set_dhcps_lease(&lease)) {
751 ESP_LOGE(TAG,
"Setting SoftAP DHCP lease failed!");
756 if (!wifi_softap_set_dhcps_lease_time(1440)) {
757 ESP_LOGE(TAG,
"Setting SoftAP DHCP lease time failed!");
761 #if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(3, 1, 0) 762 ESP8266WiFiClass::softAPDhcpServer().setRouter(
true);
766 if (!wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &mode)) {
767 ESP_LOGE(TAG,
"wifi_softap_set_dhcps_offer_option failed!");
772 if (!wifi_softap_dhcps_start()) {
773 ESP_LOGE(TAG,
"Starting SoftAP DHCPS failed!");
785 struct softap_config conf {};
786 if (ap.
get_ssid().size() >
sizeof(conf.ssid)) {
787 ESP_LOGE(TAG,
"AP SSID is too long");
790 memcpy(reinterpret_cast<char *>(conf.ssid), ap.
get_ssid().c_str(), ap.
get_ssid().size());
791 conf.ssid_len =
static_cast<uint8
>(ap.
get_ssid().size());
794 conf.max_connection = 5;
795 conf.beacon_interval = 100;
798 conf.authmode = AUTH_OPEN;
801 conf.authmode = AUTH_WPA2_PSK;
803 ESP_LOGE(TAG,
"AP password is too long");
809 ETS_UART_INTR_DISABLE();
810 bool ret = wifi_softap_set_config_current(&conf);
811 ETS_UART_INTR_ENABLE();
814 ESP_LOGV(TAG,
"wifi_softap_set_config_current failed!");
819 ESP_LOGV(TAG,
"wifi_ap_ip_config_ failed!");
827 struct ip_info ip {};
828 wifi_get_ip_info(SOFTAP_IF, &ip);
831 #endif // USE_WIFI_AP 835 uint8_t *raw_bssid = WiFi.BSSID();
836 if (raw_bssid !=
nullptr) {
837 for (
size_t i = 0; i < bssid.size(); i++)
838 bssid[i] = raw_bssid[i];
std::string format_ip_addr(struct ipv4_addr ip)
WiFiSTAConnectStatus wifi_sta_connect_status_()
std::array< uint8_t, 6 > bssid_t
static std::string format_mac_addr(const uint8_t mac[6])
const std::string & get_password() const
WiFiPowerSaveMode power_save_
network::IPAddress wifi_dns_ip_(int num)
network::IPAddresses wifi_sta_ip_addresses()
bool wifi_mode_(optional< bool > sta, optional< bool > ap)
bool wifi_apply_output_power_(float output_power)
int32_t get_wifi_channel()
bool wifi_sta_ip_config_(optional< ManualIP > manual_ip)
network::IPAddress wifi_subnet_mask_()
bool wifi_apply_hostname_()
bool error_from_callback_
const char * get_op_mode_str(uint8_t mode)
std::vector< WiFiScanResult > scan_result_
void netif_set_addr(struct netif *netif, const ip4_addr_t *ip, const ip4_addr_t *netmask, const ip4_addr_t *gw)
struct netif * eagle_lwip_getif(int netif_index)
bool wifi_start_ap_(const WiFiAP &ap)
const optional< ManualIP > & get_manual_ip() const
const optional< uint8_t > & get_channel() const
BedjetMode mode
BedJet operating mode.
bool wifi_apply_power_save_()
Application App
Global storage of Application pointer - only one Application can exist.
bool wifi_ap_ip_config_(optional< ManualIP > manual_ip)
WiFiComponent * global_wifi_component
const std::string & get_name() const
Get the name of this Application set by pre_setup().
std::array< IPAddress, 5 > IPAddresses
static void s_wifi_scan_done_callback(void *arg, STATUS status)
network::IPAddress wifi_soft_ap_ip()
void wifi_scan_done_callback_(void *arg, STATUS status)
bool wifi_sta_pre_setup_()
const char * get_auth_mode_str(uint8_t mode)
network::IPAddress wifi_gateway_ip_()
bool wifi_scan_start_(bool passive)
Implementation of SPI Controller mode.
static void wifi_event_callback(System_Event_t *event)
const std::string & get_ssid() const
const char * get_disconnect_reason_str(uint8_t reason)
void wifi_scan_done_callback_()
value_type value_or(U const &v) const
bool wifi_sta_connect_(const WiFiAP &ap)
void IRAM_ATTR HOT delay(uint32_t ms)