From b97dbd7e8eb0679d578f0378c8418f3a7f10c062 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Sun, 25 Jun 2023 12:44:09 -0400 Subject: [PATCH] test --- data/tracker_config.json | 1 + src/configuration.cpp | 1 + src/configuration.h | 1 + src/msg_utils.cpp | 7 +++++-- src/station_utils.cpp | 6 +++++- src/utils.cpp | 7 ++++++- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/data/tracker_config.json b/data/tracker_config.json index e786de4..e7556e9 100644 --- a/data/tracker_config.json +++ b/data/tracker_config.json @@ -61,6 +61,7 @@ "displayEcoMode": false, "displayTimeout": 4, "overlay": "/", + "path": "WIDE1-1", "nonSmartBeaconRate": 15, "rememberStationTime": 30, "maxDistanceToTracker": 30, diff --git a/src/configuration.cpp b/src/configuration.cpp index 52b2f2a..cada87d 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -54,6 +54,7 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) { displayEcoMode = data["other"]["displayEcoMode"].as(); displayTimeout = data["other"]["displayTimeout"].as(); overlay = data["other"]["overlay"].as(); + path = data["other"]["path"].as(); nonSmartBeaconRate = data["other"]["nonSmartBeaconRate"].as(); rememberStationTime = data["other"]["rememberStationTime"].as(); maxDistanceToTracker = data["other"]["maxDistanceToTracker"].as(); diff --git a/src/configuration.h b/src/configuration.h index a6d7d7f..9e923a4 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -40,6 +40,7 @@ public: bool displayEcoMode; int displayTimeout; String overlay; + String path; int nonSmartBeaconRate; int rememberStationTime; int maxDistanceToTracker; diff --git a/src/msg_utils.cpp b/src/msg_utils.cpp index c83359a..a3c49d3 100644 --- a/src/msg_utils.cpp +++ b/src/msg_utils.cpp @@ -120,8 +120,11 @@ void sendMessage(String station, String textMessage) { for(int i = station.length(); i < 9; i++) { station += ' '; } - messageToSend = currentBeacon->callsign + ">APLR01,WIDE1-1::" + station + ":" + textMessage; - + messageToSend = currentBeacon->callsign + ">APLRT1"; + if (Config.path != "") { + messageToSend += "," + Config.path; + } + messageToSend += "::" + station + ":" + textMessage; if (textMessage.indexOf("ack")== 0) { show_display("<>", 500); } else if (station.indexOf("CD2RXU-15") == 0 && textMessage.indexOf("wrl")==0) { diff --git a/src/station_utils.cpp b/src/station_utils.cpp index 8ce545a..f9f7128 100644 --- a/src/station_utils.cpp +++ b/src/station_utils.cpp @@ -379,7 +379,11 @@ void checkSmartBeaconState() { } void sendBeacon() { - String packet = currentBeacon->callsign + ">APLRT1,WIDE1-1:!" + Config.overlay; + String packet = currentBeacon->callsign + ">APLRT1"; + if (Config.path != "") { + packet += "," + Config.path; + } + packet += ":!" + Config.overlay; packet += GPS_Utils::encondeGPS(); if (currentBeacon->comment != "") { diff --git a/src/utils.cpp b/src/utils.cpp index 7c80606..8399020 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -46,7 +46,12 @@ String createTimeString(time_t t) { void startingStatus() { delay(3000); - LoRa_Utils::sendNewPacket(currentBeacon->callsign + ">APLRT1,WIDE1-1:>https://github.com/richonguzman/LoRa_APRS_Tracker"); + String packet = currentBeacon->callsign + ">APLRT1"; + if (Config.path != "") { + packet += "," + Config.path; + } + packet += ":>https://github.com/richonguzman/LoRa_APRS_Tracker"; + LoRa_Utils::sendNewPacket(packet); statusState = false; }