From 619a1ea5bf1850b3c652230e07eb646ddf1006ee Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Sun, 23 May 2021 23:04:10 +0200 Subject: [PATCH] move some router stuff into the router class --- src/TaskModem.cpp | 10 ---------- src/TaskRouter.cpp | 12 +++++++++++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/TaskModem.cpp b/src/TaskModem.cpp index 0414d05..336b06e 100644 --- a/src/TaskModem.cpp +++ b/src/TaskModem.cpp @@ -47,16 +47,6 @@ bool ModemTask::loop(System &system) { logPrintD(" and SNR "); logPrintlnD(String(_lora_aprs.packetSnr())); - String path = msg->getPath(); - if (path.indexOf("RFONLY") != -1 || path.indexOf("NOGATE") != -1 || path.indexOf("TCPIP") != -1) { - return true; - } - - if (!path.isEmpty()) { - path += ","; - } - msg->setPath(path + "qAR," + system.getUserConfig()->callsign); - _fromModem.addElement(msg); system.getDisplay().addFrame(std::shared_ptr(new TextFrame("LoRa", msg->toString()))); } diff --git a/src/TaskRouter.cpp b/src/TaskRouter.cpp index 249c5a0..73f5ba3 100644 --- a/src/TaskRouter.cpp +++ b/src/TaskRouter.cpp @@ -31,7 +31,17 @@ bool RouterTask::setup(System &system) { bool RouterTask::loop(System &system) { // do routing if (!_fromModem.empty()) { - _toAprsIs.addElement(_fromModem.getElement()); + std::shared_ptr msg = _fromModem.getElement(); + String path = msg->getPath(); + + 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); + } } // check for beacon