sforkowany z mirror/meshtastic-firmware
portduino wip
rodzic
e7af338c31
commit
c25efac0c1
|
@ -68,5 +68,6 @@
|
|||
"protobufs",
|
||||
"wifi"
|
||||
],
|
||||
"C_Cpp.dimInactiveRegions": true
|
||||
"C_Cpp.dimInactiveRegions": true,
|
||||
"cmake.configureOnOpen": true
|
||||
}
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -48,3 +48,5 @@ class WiFiServerPort : public WiFiServer, private concurrency::OSThread
|
|||
|
||||
int32_t runOnce();
|
||||
};
|
||||
|
||||
void initApiServer();
|
||||
|
|
Ładowanie…
Reference in New Issue