avoid global vars

pull/90/head
Christoph Kottke 2021-05-25 12:21:55 +01:00
rodzic da1be0cc6e
commit 0880428184
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -33,11 +33,10 @@ bool RouterTask::loop(System &system) {
// do routing
if (!_fromModem.empty()) {
std::shared_ptr<APRSMessage> modemMsg = _fromModem.getElement();
String path;
if (system.getUserConfig()->aprs_is.active && modemMsg->getSource() != system.getUserConfig()->callsign) {
std::shared_ptr<APRSMessage> aprsIsMsg = std::make_shared<APRSMessage>(*modemMsg);
path = aprsIsMsg->getPath();
String path = aprsIsMsg->getPath();
if (!(path.indexOf("RFONLY") != -1 || path.indexOf("NOGATE") != -1 || path.indexOf("TCPIP") != -1)) {
if (!path.isEmpty()) {
@ -62,7 +61,7 @@ bool RouterTask::loop(System &system) {
if (system.getUserConfig()->digi.active && modemMsg->getSource() != system.getUserConfig()->callsign) {
std::shared_ptr<APRSMessage> digiMsg = std::make_shared<APRSMessage>(*modemMsg);
path = digiMsg->getPath();
String path = digiMsg->getPath();
// simple loop check
if (path.indexOf("WIDE1-1") >= 0 || path.indexOf(system.getUserConfig()->callsign) == -1) {