mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-28 18:47:40 +00:00
Merge pull request #1855 from meshtastic/remove-softap
Remove Captive Portal and SoftAP Mode
This commit is contained in:
commit
c0770402ce
@ -1390,7 +1390,6 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
{
|
{
|
||||||
#if HAS_WIFI
|
#if HAS_WIFI
|
||||||
const char *wifiName = config.network.wifi_ssid;
|
const char *wifiName = config.network.wifi_ssid;
|
||||||
const char *wifiPsw = config.network.wifi_psk;
|
|
||||||
|
|
||||||
displayedNodeNum = 0; // Not currently showing a node pane
|
displayedNodeNum = 0; // Not currently showing a node pane
|
||||||
|
|
||||||
@ -1399,11 +1398,7 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
// The coordinates define the left starting point of the text
|
// The coordinates define the left starting point of the text
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
|
|
||||||
if (isSoftAPForced()) {
|
if (WiFi.status() != WL_CONNECTED) {
|
||||||
display->drawString(x, y, String("WiFi: Software AP (Admin)"));
|
|
||||||
} else if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT || config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN) {
|
|
||||||
display->drawString(x, y, String("WiFi: Software AP"));
|
|
||||||
} else if (WiFi.status() != WL_CONNECTED) {
|
|
||||||
display->drawString(x, y, String("WiFi: Not Connected"));
|
display->drawString(x, y, String("WiFi: Not Connected"));
|
||||||
} else {
|
} else {
|
||||||
display->drawString(x, y, String("WiFi: Connected"));
|
display->drawString(x, y, String("WiFi: Connected"));
|
||||||
@ -1424,25 +1419,14 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
- WL_NO_SHIELD: assigned when no WiFi shield is present;
|
- WL_NO_SHIELD: assigned when no WiFi shield is present;
|
||||||
|
|
||||||
*/
|
*/
|
||||||
if (WiFi.status() == WL_CONNECTED || isSoftAPForced() || config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT || config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN) {
|
if (WiFi.status() == WL_CONNECTED) {
|
||||||
if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT || config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN || isSoftAPForced()) {
|
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "IP: " + String(WiFi.softAPIP().toString().c_str()));
|
|
||||||
|
|
||||||
// Number of connections to the AP. Default max for the esp32 is 4
|
|
||||||
display->drawString(x + SCREEN_WIDTH - display->getStringWidth("(" + String(WiFi.softAPgetStationNum()) + "/4)"),
|
|
||||||
y + FONT_HEIGHT_SMALL * 1, "(" + String(WiFi.softAPgetStationNum()) + "/4)");
|
|
||||||
} else {
|
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "IP: " + String(WiFi.localIP().toString().c_str()));
|
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "IP: " + String(WiFi.localIP().toString().c_str()));
|
||||||
}
|
|
||||||
|
|
||||||
} else if (WiFi.status() == WL_NO_SSID_AVAIL) {
|
} else if (WiFi.status() == WL_NO_SSID_AVAIL) {
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "SSID Not Found");
|
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "SSID Not Found");
|
||||||
} else if (WiFi.status() == WL_CONNECTION_LOST) {
|
} else if (WiFi.status() == WL_CONNECTION_LOST) {
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Connection Lost");
|
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Connection Lost");
|
||||||
} else if (WiFi.status() == WL_CONNECT_FAILED) {
|
} else if (WiFi.status() == WL_CONNECT_FAILED) {
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Connection Failed");
|
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Connection Failed");
|
||||||
//} else if (WiFi.status() == WL_DISCONNECTED) {
|
|
||||||
// display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Disconnected");
|
|
||||||
} else if (WiFi.status() == WL_IDLE_STATUS) {
|
} else if (WiFi.status() == WL_IDLE_STATUS) {
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Idle ... Reconnecting");
|
display->drawString(x, y + FONT_HEIGHT_SMALL * 1, "Idle ... Reconnecting");
|
||||||
} else {
|
} else {
|
||||||
@ -1509,24 +1493,8 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSoftAPForced()) {
|
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: " + String(wifiName));
|
||||||
if ((millis() / 10000) % 2) {
|
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: meshtasticAdmin");
|
|
||||||
} else {
|
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "PWD: 12345678");
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (config.network.wifi_mode== Config_NetworkConfig_WiFiMode_ACCESS_POINT || config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN) {
|
|
||||||
if ((millis() / 10000) % 2) {
|
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: " + String(wifiName));
|
|
||||||
} else {
|
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "PWD: " + String(wifiPsw));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 2, "SSID: " + String(wifiName));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
display->drawString(x, y + FONT_HEIGHT_SMALL * 3, "http://meshtastic.local");
|
display->drawString(x, y + FONT_HEIGHT_SMALL * 3, "http://meshtastic.local");
|
||||||
|
|
||||||
/* Display a heartbeat pixel that blinks every time the frame is redrawn */
|
/* Display a heartbeat pixel that blinks every time the frame is redrawn */
|
||||||
|
10
src/main.cpp
10
src/main.cpp
@ -197,8 +197,6 @@ void setup()
|
|||||||
digitalWrite(RESET_OLED, 1);
|
digitalWrite(RESET_OLED, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool forceSoftAP = 0;
|
|
||||||
|
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
|
|
||||||
@ -211,12 +209,6 @@ void setup()
|
|||||||
delay(10);
|
delay(10);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// BUTTON_PIN is pulled high by a 12k resistor.
|
|
||||||
if (!digitalRead(BUTTON_PIN)) {
|
|
||||||
forceSoftAP = 1;
|
|
||||||
DEBUG_MSG("Setting forceSoftAP = 1\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -452,7 +444,7 @@ void setup()
|
|||||||
|
|
||||||
#ifndef ARCH_PORTDUINO
|
#ifndef ARCH_PORTDUINO
|
||||||
// Initialize Wifi
|
// Initialize Wifi
|
||||||
initWifi(forceSoftAP);
|
initWifi();
|
||||||
|
|
||||||
// Initialize Ethernet
|
// Initialize Ethernet
|
||||||
initEthernet();
|
initEthernet();
|
||||||
|
@ -75,8 +75,8 @@ void registerHandlers(HTTPServer *insecureServer, HTTPSServer *secureServer)
|
|||||||
ResourceNode *nodeAPIv1ToRadio = new ResourceNode("/api/v1/toradio", "PUT", &handleAPIv1ToRadio);
|
ResourceNode *nodeAPIv1ToRadio = new ResourceNode("/api/v1/toradio", "PUT", &handleAPIv1ToRadio);
|
||||||
ResourceNode *nodeAPIv1FromRadio = new ResourceNode("/api/v1/fromradio", "GET", &handleAPIv1FromRadio);
|
ResourceNode *nodeAPIv1FromRadio = new ResourceNode("/api/v1/fromradio", "GET", &handleAPIv1FromRadio);
|
||||||
|
|
||||||
ResourceNode *nodeHotspotApple = new ResourceNode("/hotspot-detect.html", "GET", &handleHotspot);
|
// ResourceNode *nodeHotspotApple = new ResourceNode("/hotspot-detect.html", "GET", &handleHotspot);
|
||||||
ResourceNode *nodeHotspotAndroid = new ResourceNode("/generate_204", "GET", &handleHotspot);
|
// ResourceNode *nodeHotspotAndroid = new ResourceNode("/generate_204", "GET", &handleHotspot);
|
||||||
|
|
||||||
ResourceNode *nodeAdmin = new ResourceNode("/admin", "GET", &handleAdmin);
|
ResourceNode *nodeAdmin = new ResourceNode("/admin", "GET", &handleAdmin);
|
||||||
// ResourceNode *nodeAdminSettings = new ResourceNode("/admin/settings", "GET", &handleAdminSettings);
|
// ResourceNode *nodeAdminSettings = new ResourceNode("/admin/settings", "GET", &handleAdminSettings);
|
||||||
@ -100,8 +100,8 @@ void registerHandlers(HTTPServer *insecureServer, HTTPSServer *secureServer)
|
|||||||
secureServer->registerNode(nodeAPIv1ToRadioOptions);
|
secureServer->registerNode(nodeAPIv1ToRadioOptions);
|
||||||
secureServer->registerNode(nodeAPIv1ToRadio);
|
secureServer->registerNode(nodeAPIv1ToRadio);
|
||||||
secureServer->registerNode(nodeAPIv1FromRadio);
|
secureServer->registerNode(nodeAPIv1FromRadio);
|
||||||
secureServer->registerNode(nodeHotspotApple);
|
// secureServer->registerNode(nodeHotspotApple);
|
||||||
secureServer->registerNode(nodeHotspotAndroid);
|
// secureServer->registerNode(nodeHotspotAndroid);
|
||||||
secureServer->registerNode(nodeRestart);
|
secureServer->registerNode(nodeRestart);
|
||||||
secureServer->registerNode(nodeFormUpload);
|
secureServer->registerNode(nodeFormUpload);
|
||||||
secureServer->registerNode(nodeJsonScanNetworks);
|
secureServer->registerNode(nodeJsonScanNetworks);
|
||||||
@ -121,8 +121,8 @@ void registerHandlers(HTTPServer *insecureServer, HTTPSServer *secureServer)
|
|||||||
insecureServer->registerNode(nodeAPIv1ToRadioOptions);
|
insecureServer->registerNode(nodeAPIv1ToRadioOptions);
|
||||||
insecureServer->registerNode(nodeAPIv1ToRadio);
|
insecureServer->registerNode(nodeAPIv1ToRadio);
|
||||||
insecureServer->registerNode(nodeAPIv1FromRadio);
|
insecureServer->registerNode(nodeAPIv1FromRadio);
|
||||||
insecureServer->registerNode(nodeHotspotApple);
|
// insecureServer->registerNode(nodeHotspotApple);
|
||||||
insecureServer->registerNode(nodeHotspotAndroid);
|
// insecureServer->registerNode(nodeHotspotAndroid);
|
||||||
insecureServer->registerNode(nodeRestart);
|
insecureServer->registerNode(nodeRestart);
|
||||||
insecureServer->registerNode(nodeFormUpload);
|
insecureServer->registerNode(nodeFormUpload);
|
||||||
insecureServer->registerNode(nodeJsonScanNetworks);
|
insecureServer->registerNode(nodeJsonScanNetworks);
|
||||||
@ -620,12 +620,8 @@ void handleReport(HTTPRequest *req, HTTPResponse *res)
|
|||||||
};
|
};
|
||||||
|
|
||||||
// data->wifi
|
// data->wifi
|
||||||
String ipStr;
|
String ipStr = String(WiFi.localIP().toString());
|
||||||
if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT || config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN || isSoftAPForced()) {
|
|
||||||
ipStr = String(WiFi.softAPIP().toString());
|
|
||||||
} else {
|
|
||||||
ipStr = String(WiFi.localIP().toString());
|
|
||||||
}
|
|
||||||
Json jsonObjWifi = Json::object{{"rssi", String(WiFi.RSSI())}, {"ip", ipStr.c_str()}};
|
Json jsonObjWifi = Json::object{{"rssi", String(WiFi.RSSI())}, {"ip", ipStr.c_str()}};
|
||||||
|
|
||||||
// data->memory
|
// data->memory
|
||||||
|
@ -55,10 +55,6 @@ static void handleWebResponse()
|
|||||||
if (isWifiAvailable()) {
|
if (isWifiAvailable()) {
|
||||||
|
|
||||||
if (isWebServerReady) {
|
if (isWebServerReady) {
|
||||||
// We're going to handle the DNS responder here so it
|
|
||||||
// will be ignored by the NRF boards.
|
|
||||||
handleDNSResponse();
|
|
||||||
|
|
||||||
if (secureServer)
|
if (secureServer)
|
||||||
secureServer->loop();
|
secureServer->loop();
|
||||||
insecureServer->loop();
|
insecureServer->loop();
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include "mesh/wifi/WiFiServerAPI.h"
|
#include "mesh/wifi/WiFiServerAPI.h"
|
||||||
#include "mqtt/MQTT.h"
|
#include "mqtt/MQTT.h"
|
||||||
#include "target_specific.h"
|
#include "target_specific.h"
|
||||||
#include <DNSServer.h>
|
|
||||||
#include <ESPmDNS.h>
|
#include <ESPmDNS.h>
|
||||||
#include <esp_wifi.h>
|
#include <esp_wifi.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
@ -22,9 +21,6 @@ using namespace concurrency;
|
|||||||
|
|
||||||
static void WiFiEvent(WiFiEvent_t event);
|
static void WiFiEvent(WiFiEvent_t event);
|
||||||
|
|
||||||
// DNS Server for the Captive Portal
|
|
||||||
DNSServer dnsServer;
|
|
||||||
|
|
||||||
// NTP
|
// NTP
|
||||||
WiFiUDP ntpUDP;
|
WiFiUDP ntpUDP;
|
||||||
|
|
||||||
@ -37,8 +33,6 @@ uint8_t wifiDisconnectReason = 0;
|
|||||||
// Stores our hostname
|
// Stores our hostname
|
||||||
char ourHost[16];
|
char ourHost[16];
|
||||||
|
|
||||||
bool forcedSoftAP = 0;
|
|
||||||
|
|
||||||
bool APStartupComplete = 0;
|
bool APStartupComplete = 0;
|
||||||
|
|
||||||
static bool needReconnect = true; // If we create our reconnector, run it once at the beginning
|
static bool needReconnect = true; // If we create our reconnector, run it once at the beginning
|
||||||
@ -88,16 +82,10 @@ static int32_t reconnectWiFi()
|
|||||||
|
|
||||||
static Periodic *wifiReconnect;
|
static Periodic *wifiReconnect;
|
||||||
|
|
||||||
bool isSoftAPForced()
|
|
||||||
{
|
|
||||||
return forcedSoftAP;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isWifiAvailable()
|
bool isWifiAvailable()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (config.network.wifi_enabled && ((config.network.wifi_ssid[0]) || forcedSoftAP)) {
|
if (config.network.wifi_enabled && (config.network.wifi_ssid[0])) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -161,70 +149,19 @@ static void onNetworkConnected()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Startup WiFi
|
// Startup WiFi
|
||||||
bool initWifi(bool forceSoftAP)
|
bool initWifi()
|
||||||
{
|
{
|
||||||
forcedSoftAP = forceSoftAP;
|
if (config.network.wifi_enabled && config.network.wifi_ssid[0]) {
|
||||||
|
|
||||||
if (config.network.wifi_enabled && ((config.network.wifi_ssid[0]) || forceSoftAP)) {
|
|
||||||
// if ((radioConfig.has_preferences && config.wifi.ssid[0]) || forceSoftAP) {
|
|
||||||
const char *wifiName = config.network.wifi_ssid;
|
const char *wifiName = config.network.wifi_ssid;
|
||||||
const char *wifiPsw = config.network.wifi_psk;
|
const char *wifiPsw = config.network.wifi_psk;
|
||||||
|
|
||||||
if (forceSoftAP) {
|
|
||||||
DEBUG_MSG("WiFi ... Forced AP Mode\n");
|
|
||||||
} else if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT) {
|
|
||||||
DEBUG_MSG("WiFi ... AP Mode\n");
|
|
||||||
} else if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN) {
|
|
||||||
DEBUG_MSG("WiFi ... Hidden AP Mode\n");
|
|
||||||
} else if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_CLIENT) {
|
|
||||||
DEBUG_MSG("WiFi ... Client Mode\n");
|
|
||||||
} else {
|
|
||||||
DEBUG_MSG("WiFi ... WiFi Disabled\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
createSSLCert();
|
createSSLCert();
|
||||||
|
|
||||||
if (!*wifiPsw) // Treat empty password as no password
|
if (!*wifiPsw) // Treat empty password as no password
|
||||||
wifiPsw = NULL;
|
wifiPsw = NULL;
|
||||||
|
|
||||||
if (*wifiName || forceSoftAP) {
|
if (*wifiName) {
|
||||||
if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT || config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN || forceSoftAP) {
|
|
||||||
|
|
||||||
IPAddress apIP(192, 168, 42, 1);
|
|
||||||
WiFi.onEvent(WiFiEvent);
|
|
||||||
WiFi.mode(WIFI_AP);
|
|
||||||
|
|
||||||
if (forcedSoftAP) {
|
|
||||||
const char *softAPssid = "meshtasticAdmin";
|
|
||||||
const char *softAPpasswd = "12345678";
|
|
||||||
int ok = WiFi.softAP(softAPssid, softAPpasswd);
|
|
||||||
DEBUG_MSG("Starting (Forced) WIFI AP: ssid=%s, ok=%d\n", softAPssid, ok);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// If AP is configured to be hidden hidden
|
|
||||||
if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN) {
|
|
||||||
|
|
||||||
// The configurations on softAP are from the espresif library
|
|
||||||
int ok = WiFi.softAP(wifiName, wifiPsw, 1, 1, 4);
|
|
||||||
DEBUG_MSG("Starting hidden WIFI AP: ssid=%s, ok=%d\n", wifiName, ok);
|
|
||||||
} else {
|
|
||||||
int ok = WiFi.softAP(wifiName, wifiPsw);
|
|
||||||
DEBUG_MSG("Starting WIFI AP: ssid=%s, ok=%d\n", wifiName, ok);
|
|
||||||
}
|
|
||||||
int ok = WiFi.softAP(wifiName, wifiPsw);
|
|
||||||
DEBUG_MSG("Starting WIFI AP: ssid=%s, ok=%d\n", wifiName, ok);
|
|
||||||
}
|
|
||||||
|
|
||||||
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
|
|
||||||
DEBUG_MSG("MY IP AP ADDRESS: %s\n", WiFi.softAPIP().toString().c_str());
|
|
||||||
|
|
||||||
// This is needed to improve performance.
|
|
||||||
esp_wifi_set_ps(WIFI_PS_NONE); // Disable radio power saving
|
|
||||||
|
|
||||||
dnsServer.start(53, "*", apIP);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
uint8_t dmac[6];
|
uint8_t dmac[6];
|
||||||
getMacAddr(dmac);
|
getMacAddr(dmac);
|
||||||
sprintf(ourHost, "Meshtastic-%02x%02x", dmac[4], dmac[5]);
|
sprintf(ourHost, "Meshtastic-%02x%02x", dmac[4], dmac[5]);
|
||||||
@ -255,7 +192,6 @@ bool initWifi(bool forceSoftAP)
|
|||||||
DEBUG_MSG("JOINING WIFI soon: ssid=%s\n", wifiName);
|
DEBUG_MSG("JOINING WIFI soon: ssid=%s\n", wifiName);
|
||||||
wifiReconnect = new Periodic("WifiConnect", reconnectWiFi);
|
wifiReconnect = new Periodic("WifiConnect", reconnectWiFi);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("Not using WIFI\n");
|
DEBUG_MSG("Not using WIFI\n");
|
||||||
@ -356,13 +292,6 @@ static void WiFiEvent(WiFiEvent_t event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleDNSResponse()
|
|
||||||
{
|
|
||||||
if (config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT || config.network.wifi_mode == Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN || isSoftAPForced()) {
|
|
||||||
dnsServer.processNextRequest();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getWifiDisconnectReason()
|
uint8_t getWifiDisconnectReason()
|
||||||
{
|
{
|
||||||
return wifiDisconnectReason;
|
return wifiDisconnectReason;
|
||||||
|
@ -5,19 +5,14 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
#include <DNSServer.h>
|
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// @return true if wifi is now in use
|
/// @return true if wifi is now in use
|
||||||
bool initWifi(bool forceSoftAP);
|
bool initWifi();
|
||||||
|
|
||||||
void deinitWifi();
|
void deinitWifi();
|
||||||
|
|
||||||
bool isWifiAvailable();
|
bool isWifiAvailable();
|
||||||
|
|
||||||
void handleDNSResponse();
|
|
||||||
|
|
||||||
bool isSoftAPForced();
|
|
||||||
|
|
||||||
uint8_t getWifiDisconnectReason();
|
uint8_t getWifiDisconnectReason();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#if (HAS_WIFI == 0)
|
#if (HAS_WIFI == 0)
|
||||||
|
|
||||||
bool initWifi(bool forceSoftAP) {
|
bool initWifi() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user