2023-01-09 17:03:52 +01:00
|
|
|
#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);
|
2024-10-14 06:11:43 +02:00
|
|
|
LOG_INFO("API server listening on TCP port %d", port);
|
2023-01-09 17:03:52 +01:00
|
|
|
apiPort->init();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ethServerAPI::ethServerAPI(EthernetClient &_client) : ServerAPI(_client)
|
|
|
|
|
{
|
2024-10-14 06:11:43 +02:00
|
|
|
LOG_INFO("Incoming ethernet connection");
|
2023-01-09 17:03:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ethServerPort::ethServerPort(int port) : APIServerPort(port) {}
|
|
|
|
|
|
|
|
|
|
#endif
|