From ccfc0ceb120c16f455c8233a5cdec3d736e29019 Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Mon, 24 May 2021 15:50:30 +0100 Subject: [PATCH] update routing to APRS-IS --- src/TaskRouter.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/TaskRouter.cpp b/src/TaskRouter.cpp index db3b811..09afb91 100644 --- a/src/TaskRouter.cpp +++ b/src/TaskRouter.cpp @@ -35,17 +35,20 @@ bool RouterTask::setup(System &system) { bool RouterTask::loop(System &system) { // do routing if (!_fromModem.empty()) { - std::shared_ptr msg = _fromModem.getElement(); - String path = msg->getPath(); + std::shared_ptr modemMsg = _fromModem.getElement(); - if (!(path.indexOf("RFONLY") != -1 || path.indexOf("NOGATE") != -1 || path.indexOf("TCPIP") != -1)) { - if (!path.isEmpty()) { - path += ","; - } - msg->setPath(path + "qAR," + system.getUserConfig()->callsign); + if (system.getUserConfig()->aprs_is.active && modemMsg->getSource() != system.getUserConfig()->callsign) { + std::shared_ptr msg = std::make_shared(*modemMsg); + String path = msg->getPath(); - if (system.getUserConfig()->aprs_is.active) + if (!(path.indexOf("RFONLY") != -1 || path.indexOf("NOGATE") != -1 || path.indexOf("TCPIP") != -1)) { + if (!path.isEmpty()) { + path += ","; + } + + msg->setPath(path + "qAR," + system.getUserConfig()->callsign); _toAprsIs.addElement(msg); + } } }