mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-04 03:18:10 +10:00
* ThinkNode G3, ETH support WIP * ThinkNode G3, ETH support WIP * ThinkNode G3, ETH support WIP * ThinkNode G3, ETH support WIP * ThinkNode G3, ETH support WIP * ThinkNode G3, ETH support WIP * ThinkNode G3, ETH support WIP * rename variant and add guard macros * older G3 operational. M7 next. * Split out G3 and M7 to different variants. Completely new PCB design. The G3 stays on 'PRIVATE_HW' * Define button behaviour and use all of the device flash --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: caveman99 <25002+caveman99@users.noreply.github.com> Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
37 lines
765 B
C++
37 lines
765 B
C++
#include "configuration.h"
|
|
#include <Arduino.h>
|
|
|
|
#if HAS_ETHERNET && !defined(USE_WS5500) && !defined(USE_CH390D)
|
|
|
|
#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", port);
|
|
apiPort->init();
|
|
}
|
|
}
|
|
|
|
void deInitApiServer()
|
|
{
|
|
if (apiPort) {
|
|
LOG_INFO("Deinit API server");
|
|
delete apiPort;
|
|
apiPort = nullptr;
|
|
}
|
|
}
|
|
|
|
ethServerAPI::ethServerAPI(EthernetClient &_client) : ServerAPI(_client)
|
|
{
|
|
LOG_INFO("Incoming ethernet connection");
|
|
api_type = TYPE_ETH;
|
|
}
|
|
|
|
ethServerPort::ethServerPort(int port) : APIServerPort(port) {}
|
|
|
|
#endif |