mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-18 11:02:16 +00:00
portduino wip
This commit is contained in:
parent
e7af338c31
commit
c25efac0c1
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -68,5 +68,6 @@
|
|||||||
"protobufs",
|
"protobufs",
|
||||||
"wifi"
|
"wifi"
|
||||||
],
|
],
|
||||||
"C_Cpp.dimInactiveRegions": true
|
"C_Cpp.dimInactiveRegions": true,
|
||||||
|
"cmake.configureOnOpen": true
|
||||||
}
|
}
|
@ -32,6 +32,10 @@
|
|||||||
#include "nimble/BluetoothUtil.h"
|
#include "nimble/BluetoothUtil.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PORTDUINO
|
||||||
|
#include "mesh/wifi/WiFiServerAPI.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "RF95Interface.h"
|
#include "RF95Interface.h"
|
||||||
#include "SX1262Interface.h"
|
#include "SX1262Interface.h"
|
||||||
|
|
||||||
@ -524,6 +528,10 @@ void setup()
|
|||||||
webServerThread = new WebServerThread();
|
webServerThread = new WebServerThread();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PORTDUINO
|
||||||
|
initApiServer();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Start airtime logger thread.
|
// Start airtime logger thread.
|
||||||
airTime = new AirTime();
|
airTime = new AirTime();
|
||||||
|
|
||||||
|
@ -14,8 +14,6 @@ static void WiFiEvent(WiFiEvent_t event);
|
|||||||
// DNS Server for the Captive Portal
|
// DNS Server for the Captive Portal
|
||||||
DNSServer dnsServer;
|
DNSServer dnsServer;
|
||||||
|
|
||||||
static WiFiServerPort *apiPort;
|
|
||||||
|
|
||||||
uint8_t wifiDisconnectReason = 0;
|
uint8_t wifiDisconnectReason = 0;
|
||||||
|
|
||||||
// Stores our hostname
|
// Stores our hostname
|
||||||
@ -180,14 +178,7 @@ void initWifi(bool forceSoftAP)
|
|||||||
DEBUG_MSG("Not using WIFI\n");
|
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
|
// Called by the Espressif SDK to
|
||||||
static void WiFiEvent(WiFiEvent_t event)
|
static void WiFiEvent(WiFiEvent_t event)
|
||||||
|
@ -3,6 +3,17 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include <Arduino.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)
|
WiFiServerAPI::WiFiServerAPI(WiFiClient &_client) : StreamAPI(&client), client(_client)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Incoming wifi connection\n");
|
DEBUG_MSG("Incoming wifi connection\n");
|
||||||
|
@ -48,3 +48,5 @@ class WiFiServerPort : public WiFiServer, private concurrency::OSThread
|
|||||||
|
|
||||||
int32_t runOnce();
|
int32_t runOnce();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void initApiServer();
|
||||||
|
Loading…
Reference in New Issue
Block a user