move some router stuff into the router class

pull/90/head
Peter Buchegger 2021-05-23 23:04:10 +02:00
rodzic 134b566f98
commit 619a1ea5bf
2 zmienionych plików z 11 dodań i 11 usunięć

Wyświetl plik

@ -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<DisplayFrame>(new TextFrame("LoRa", msg->toString())));
}

Wyświetl plik

@ -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<APRSMessage> 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