1.2-legacy
Kevin Hester 2021-02-07 09:17:46 +08:00
rodzic e7af338c31
commit c25efac0c1
5 zmienionych plików z 24 dodań i 11 usunięć

Wyświetl plik

@ -68,5 +68,6 @@
"protobufs",
"wifi"
],
"C_Cpp.dimInactiveRegions": true
"C_Cpp.dimInactiveRegions": true,
"cmake.configureOnOpen": true
}

Wyświetl plik

@ -32,6 +32,10 @@
#include "nimble/BluetoothUtil.h"
#endif
#ifdef PORTDUINO
#include "mesh/wifi/WiFiServerAPI.h"
#endif
#include "RF95Interface.h"
#include "SX1262Interface.h"
@ -524,6 +528,10 @@ void setup()
webServerThread = new WebServerThread();
#endif
#ifdef PORTDUINO
initApiServer();
#endif
// Start airtime logger thread.
airTime = new AirTime();

Wyświetl plik

@ -14,8 +14,6 @@ static void WiFiEvent(WiFiEvent_t event);
// DNS Server for the Captive Portal
DNSServer dnsServer;
static WiFiServerPort *apiPort;
uint8_t wifiDisconnectReason = 0;
// Stores our hostname
@ -180,14 +178,7 @@ void initWifi(bool forceSoftAP)
DEBUG_MSG("Not using WIFI\n");
}
static void initApiServer()
{
// Start API server on port 4403
if (!apiPort) {
apiPort = new WiFiServerPort();
apiPort->init();
}
}
// Called by the Espressif SDK to
static void WiFiEvent(WiFiEvent_t event)

Wyświetl plik

@ -3,6 +3,17 @@
#include "configuration.h"
#include <Arduino.h>
static WiFiServerPort *apiPort;
void initApiServer()
{
// Start API server on port 4403
if (!apiPort) {
apiPort = new WiFiServerPort();
apiPort->init();
}
}
WiFiServerAPI::WiFiServerAPI(WiFiClient &_client) : StreamAPI(&client), client(_client)
{
DEBUG_MSG("Incoming wifi connection\n");

Wyświetl plik

@ -48,3 +48,5 @@ class WiFiServerPort : public WiFiServer, private concurrency::OSThread
int32_t runOnce();
};
void initApiServer();