mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 09:43:03 +00:00
27 lines
553 B
C++
27 lines
553 B
C++
|
|
#include "configuration.h"
|
||
|
|
#include <Arduino.h>
|
||
|
|
|
||
|
|
#if HAS_ETHERNET
|
||
|
|
|
||
|
|
#include "ethServerAPI.h"
|
||
|
|
|
||
|
|
static ethServerPort *apiPort;
|
||
|
|
|
||
|
|
void initApiServer(int port)
|
||
|
|
{
|
||
|
|
// Start API server on port 4403
|
||
|
|
if (!apiPort) {
|
||
|
|
apiPort = new ethServerPort(port);
|
||
|
|
LOG_INFO("API server listening on TCP port %d\n", port);
|
||
|
|
apiPort->init();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
ethServerAPI::ethServerAPI(EthernetClient &_client) : ServerAPI(_client)
|
||
|
|
{
|
||
|
|
LOG_INFO("Incoming ethernet connection\n");
|
||
|
|
}
|
||
|
|
|
||
|
|
ethServerPort::ethServerPort(int port) : APIServerPort(port) {}
|
||
|
|
|
||
|
|
#endif
|