kopia lustrzana https://github.com/lora-aprs/LoRa_APRS_iGate
move some router stuff into the router class
rodzic
134b566f98
commit
619a1ea5bf
|
@ -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())));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue