From 05adacd907f8501ef3cdd6c47c3a94acf252ab4f Mon Sep 17 00:00:00 2001 From: richonguzman Date: Sun, 3 Sep 2023 09:11:55 -0300 Subject: [PATCH] mods --- data/script.js | 21 ++++++++++++++++++++- src/aprs_is_utils.cpp | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/data/script.js b/data/script.js index f7873f1..86766c4 100644 --- a/data/script.js +++ b/data/script.js @@ -12,5 +12,24 @@ fetch('igate_conf.json') // Display JSON data in the HTML function displayJSONData(data) { const jsonContainer = document.getElementById('json-container'); - jsonContainer.innerHTML = JSON.stringify(data, null, 2); + + var jsonData = jsonContainer.textContent; + + // Parse the JSON data into a JavaScript object + try { + var parsedData = JSON.parse(jsonData); + + // Access the data in the JavaScript object + var callsign = parsedData.callsign; + //var age = parsedData.stationMode; + //var city = parsedData.city; + + // Display the parsed data + console.log("Callsign : " + callsign); + //console.log("Age: " + age); + //console.log("City: " + city); + } catch (error) { + console.error("Error parsing JSON: " + error.message); + } +// jsonContainer.innerHTML = JSON.stringify(data, null, 2); } diff --git a/src/aprs_is_utils.cpp b/src/aprs_is_utils.cpp index acb13bd..ef9917e 100644 --- a/src/aprs_is_utils.cpp +++ b/src/aprs_is_utils.cpp @@ -87,7 +87,7 @@ void processLoRaPacket(String packet) { Serial.print(" ---> APRS LoRa Packet!"); Sender = packet.substring(3,packet.indexOf(">")); if (Sender != Config.callsign) { // avoid listening yourself by digirepeating - if (stationMode == 2) { + if (stationMode == 2 || stationMode == 5) { if (packet.indexOf("::") > 10) { // its a Message! AddresseeAndMessage = packet.substring(packet.indexOf("::")+2); Addressee = AddresseeAndMessage.substring(0,AddresseeAndMessage.indexOf(":"));