mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-31 17:04:29 +00:00
Auto formatting of meshwifi.cpp
This commit is contained in:
parent
65fc1cf4a6
commit
82fbedbf41
@ -3,14 +3,14 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "meshwifi/meshhttp.h"
|
#include "meshwifi/meshhttp.h"
|
||||||
#include <WiFi.h>
|
|
||||||
#include <DNSServer.h>
|
#include <DNSServer.h>
|
||||||
|
#include <WiFi.h>
|
||||||
|
|
||||||
static void WiFiEvent(WiFiEvent_t event);
|
static void WiFiEvent(WiFiEvent_t event);
|
||||||
|
|
||||||
DNSServer dnsServer;
|
DNSServer dnsServer;
|
||||||
|
|
||||||
bool isWifiAvailable()
|
bool isWifiAvailable()
|
||||||
{
|
{
|
||||||
const char *wifiName = radioConfig.preferences.wifi_ssid;
|
const char *wifiName = radioConfig.preferences.wifi_ssid;
|
||||||
const char *wifiPsw = radioConfig.preferences.wifi_password;
|
const char *wifiPsw = radioConfig.preferences.wifi_password;
|
||||||
@ -66,7 +66,7 @@ void initWifi()
|
|||||||
|
|
||||||
if (*wifiName && *wifiPsw) {
|
if (*wifiName && *wifiPsw) {
|
||||||
if (radioConfig.preferences.wifi_ap_mode) {
|
if (radioConfig.preferences.wifi_ap_mode) {
|
||||||
|
|
||||||
IPAddress apIP(192, 168, 42, 1);
|
IPAddress apIP(192, 168, 42, 1);
|
||||||
WiFi.onEvent(WiFiEvent);
|
WiFi.onEvent(WiFiEvent);
|
||||||
|
|
||||||
@ -76,7 +76,6 @@ void initWifi()
|
|||||||
|
|
||||||
dnsServer.start(53, "*", apIP);
|
dnsServer.start(53, "*", apIP);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
WiFi.mode(WIFI_MODE_STA);
|
WiFi.mode(WIFI_MODE_STA);
|
||||||
WiFi.onEvent(WiFiEvent);
|
WiFi.onEvent(WiFiEvent);
|
||||||
@ -189,11 +188,11 @@ static void WiFiEvent(WiFiEvent_t event)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleDNSResponse() {
|
void handleDNSResponse()
|
||||||
|
{
|
||||||
if (radioConfig.preferences.wifi_ap_mode) {
|
if (radioConfig.preferences.wifi_ap_mode) {
|
||||||
dnsServer.processNextRequest();
|
dnsServer.processNextRequest();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user