From 34f794aac2c9f213bd97d1e267a47e1b52ba51b3 Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Mon, 24 May 2021 15:50:01 +0200 Subject: [PATCH] move setPath(WIDE1-1) global --- src/TaskRouter.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/TaskRouter.cpp b/src/TaskRouter.cpp index 06fd14d..db3b811 100644 --- a/src/TaskRouter.cpp +++ b/src/TaskRouter.cpp @@ -24,6 +24,7 @@ bool RouterTask::setup(System &system) { _beaconMsg = std::shared_ptr(new APRSMessage()); _beaconMsg->setSource(system.getUserConfig()->callsign); _beaconMsg->setDestination("APLG01"); + _beaconMsg->setPath("WIDE1-1"); String lat = create_lat_aprs(system.getUserConfig()->beacon.positionLatitude); String lng = create_long_aprs(system.getUserConfig()->beacon.positionLongitude); _beaconMsg->getBody()->setData(String("=") + lat + "L" + lng + "&" + system.getUserConfig()->beacon.message); @@ -56,12 +57,8 @@ bool RouterTask::loop(System &system) { if (system.getUserConfig()->aprs_is.active) _toAprsIs.addElement(_beaconMsg); - if (system.getUserConfig()->digi.beacon) { - std::shared_ptr msg = _beaconMsg; - msg->setPath("WIDE1-1"); - - _toModem.addElement(msg); - } + if (system.getUserConfig()->digi.beacon) + _toModem.addElement(_beaconMsg); system.getDisplay().addFrame(std::shared_ptr(new TextFrame("BEACON", _beaconMsg->toString())));