From 1b5eb9dbae767dea4d71561f35a55029bd9b503d Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Tue, 6 Dec 2022 17:12:55 +0100 Subject: [PATCH] Add support for more serial ports on a single agent --- espremoteagent/espremoteagent.ini | 10 +++++----- espremoteagent/main.cpp | 32 +++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/espremoteagent/espremoteagent.ini b/espremoteagent/espremoteagent.ini index f3fc7fd..3bc3f61 100644 --- a/espremoteagent/espremoteagent.ini +++ b/espremoteagent/espremoteagent.ini @@ -6,12 +6,12 @@ port=8080 listen=Any port=8081 -[PortA] -port=/dev/ttyUSB0 +[Port00] +port=/dev/ttyACM0 baudrate=115200 #url=ws://office-pi:1235/charger0 -[PortB] -port=/dev/ttyUSB1 -baudrate=115200 +#[Port01] +#port=/dev/ttyUSB1 +#baudrate=115200 #url=ws://office-pi:1235/charger1 diff --git a/espremoteagent/main.cpp b/espremoteagent/main.cpp index f87cad1..2fd4643 100644 --- a/espremoteagent/main.cpp +++ b/espremoteagent/main.cpp @@ -48,8 +48,36 @@ int main(int argc, char *argv[]) }); }; - probePort("PortA"); - probePort("PortB"); + probePort("Port00"); + probePort("Port01"); + probePort("Port02"); + probePort("Port03"); + probePort("Port04"); + probePort("Port05"); + probePort("Port06"); + probePort("Port07"); + probePort("Port08"); + probePort("Port09"); + probePort("Port10"); + probePort("Port11"); + probePort("Port12"); + probePort("Port13"); + probePort("Port14"); + probePort("Port15"); + probePort("Port16"); + probePort("Port17"); + probePort("Port18"); + probePort("Port19"); + probePort("Port20"); + probePort("Port21"); + probePort("Port22"); + probePort("Port23"); + probePort("Port24"); + probePort("Port25"); + probePort("Port26"); + probePort("Port27"); + probePort("Port28"); + probePort("Port29"); QHostAddress webserverListen = parseHostAddress(settings.value("Webserver/listen").toString()); int webserverPort;