mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-11 20:37:22 +00:00
* Add API types, state, and log message in Debug screen * un-goober the API state tracking * Set the SerialConsole api_type * Add api_type for Ethernet * Remove API state debugging code * Update wording for client connection states * Improve string width for smaller screen devices * Reserve space on navigation bar to fit link indicator * Add persistent Connected icon to screen * Connect System frame to ensure text doesn't overflow --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Jason P <applewiz@mac.com> Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com>
33 lines
668 B
C++
33 lines
668 B
C++
#include "configuration.h"
|
|
#include <Arduino.h>
|
|
|
|
#if HAS_WIFI
|
|
#include "WiFiServerAPI.h"
|
|
|
|
static WiFiServerPort *apiPort;
|
|
|
|
void initApiServer(int port)
|
|
{
|
|
// Start API server on port 4403
|
|
if (!apiPort) {
|
|
apiPort = new WiFiServerPort(port);
|
|
LOG_INFO("API server listen on TCP port %d", port);
|
|
apiPort->init();
|
|
}
|
|
}
|
|
void deInitApiServer()
|
|
{
|
|
if (apiPort) {
|
|
delete apiPort;
|
|
apiPort = nullptr;
|
|
}
|
|
}
|
|
|
|
WiFiServerAPI::WiFiServerAPI(WiFiClient &_client) : ServerAPI(_client)
|
|
{
|
|
api_type = TYPE_WIFI;
|
|
LOG_INFO("Incoming wifi connection");
|
|
}
|
|
|
|
WiFiServerPort::WiFiServerPort(int port) : APIServerPort(port) {}
|
|
#endif |