mirror of
https://github.com/esphome/esphome.git
synced 2025-09-12 00:02:21 +01:00
Support ESP8266 Arduino 3.0.0 (#1897)
Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
#include <wpa2_enterprise.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIFI_IS_OFF_AT_BOOT // Identifies ESP8266 Arduino 3.0.0
|
||||
#define ARDUINO_ESP8266_RELEASE_3
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/dns.h"
|
||||
@@ -18,6 +22,12 @@ extern "C" {
|
||||
#if LWIP_IPV6
|
||||
#include "lwip/netif.h" // struct netif
|
||||
#endif
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_3
|
||||
#include "LwipDhcpServer.h"
|
||||
#define wifi_softap_set_dhcps_lease(lease) dhcpSoftAP.set_dhcps_lease(lease)
|
||||
#define wifi_softap_set_dhcps_lease_time(time) dhcpSoftAP.set_dhcps_lease_time(time)
|
||||
#define wifi_softap_set_dhcps_offer_option(offer, mode) dhcpSoftAP.set_dhcps_offer_option(offer, mode)
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "esphome/core/helpers.h"
|
||||
@@ -649,6 +659,10 @@ bool WiFiComponent::wifi_ap_ip_config_(optional<ManualIP> manual_ip) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_3
|
||||
dhcpSoftAP.begin(&info);
|
||||
#endif
|
||||
|
||||
struct dhcps_lease lease {};
|
||||
IPAddress start_address = info.ip.addr;
|
||||
start_address[3] += 99;
|
||||
|
Reference in New Issue
Block a user