diff --git a/src/configuration.cpp b/src/configuration.cpp index 806ad93..fe83b32 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -1,17 +1,17 @@ /* Copyright (C) 2025 Ricardo Guzman - CA2RXU - * + * * This file is part of LoRa APRS iGate. - * + * * LoRa APRS iGate is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * LoRa APRS iGate is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with LoRa APRS iGate. If not, see . */ @@ -96,12 +96,12 @@ bool Configuration::writeFile() { data["lora"]["rxFreq"] = loramodule.rxFreq; data["lora"]["rxCodingRate4"] = loramodule.rxCodingRate4; data["lora"]["rxSignalBandwidth"] = loramodule.rxSignalBandwidth; - data["lora"]["txActive"] = loramodule.txActive; + data["lora"]["txActive"] = loramodule.txActive; data["lora"]["txFreq"] = loramodule.txFreq; data["lora"]["txCodingRate4"] = loramodule.txCodingRate4; - data["lora"]["txSignalBandwidth"] = loramodule.txSignalBandwidth; - data["lora"]["power"] = loramodule.power; - + data["lora"]["txSignalBandwidth"] = loramodule.txSignalBandwidth; + data["lora"]["power"] = loramodule.power; + int rxSpreadingFactor = loramodule.rxSpreadingFactor; int txSpreadingFactor = loramodule.txSpreadingFactor; #if defined(HAS_SX1276) || defined(HAS_SX1278) @@ -222,7 +222,7 @@ bool Configuration::readFile() { callsign = data["callsign"] | "NOCALL-10"; if (!data.containsKey("tacticalCallsign")) needsRewrite = true; tacticalCallsign = data["tacticalCallsign"] | ""; - + if (!data["aprs_is"].containsKey("active") || !data["aprs_is"].containsKey("passcode") || !data["aprs_is"].containsKey("server") || @@ -300,14 +300,14 @@ bool Configuration::readFile() { loramodule.rxFreq = data["lora"]["rxFreq"] | 433775000; loramodule.rxSpreadingFactor = data["lora"]["rxSpreadingFactor"] | 12; loramodule.rxCodingRate4 = data["lora"]["rxCodingRate4"] | 5; - loramodule.rxSignalBandwidth = data["lora"]["rxSignalBandwidth"] | 125000; + loramodule.rxSignalBandwidth = data["lora"]["rxSignalBandwidth"] | 125000; loramodule.txActive = data["lora"]["txActive"] | false; loramodule.txFreq = data["lora"]["txFreq"] | 433775000; loramodule.txSpreadingFactor = data["lora"]["txSpreadingFactor"] | 12; loramodule.txCodingRate4 = data["lora"]["txCodingRate4"] | 5; loramodule.txSignalBandwidth = data["lora"]["txSignalBandwidth"] | 125000; loramodule.power = data["lora"]["power"] | 20; - + if (!data["display"].containsKey("alwaysOn") || !data["display"].containsKey("timeout") || !data["display"].containsKey("turn180")) needsRewrite = true; @@ -381,7 +381,7 @@ bool Configuration::readFile() { mqtt.password = data["mqtt"]["password"] | ""; mqtt.port = data["mqtt"]["port"] | 1883; mqtt.beaconOverMqtt = data["mqtt"]["beaconOverMqtt"] | false; - + if (!data["ota"].containsKey("username") || !data["ota"].containsKey("password")) needsRewrite = true; ota.username = data["ota"]["username"] | ""; @@ -426,7 +426,7 @@ bool Configuration::readFile() { writeFile(); delay(1000); ESP.restart(); - } + } Serial.println("Config read successfuly"); return true; } else { @@ -434,7 +434,7 @@ bool Configuration::readFile() { return false; } } - + void Configuration::setDefaultValues() { WiFi_AP wifiap; @@ -470,14 +470,14 @@ void Configuration::setDefaultValues() { beacon.sendViaAPRSIS = true; beacon.sendViaRF = false; beacon.beaconFreq = 1; - + beacon.statusActive = false; - beacon.statusPacket = ""; + beacon.statusPacket = ""; beacon.gpsActive = false; beacon.ambiguityLevel = 0; - personalNote = ""; + personalNote = ""; blacklist = ""; @@ -500,7 +500,7 @@ void Configuration::setDefaultValues() { display.alwaysOn = true; display.timeout = 4; display.turn180 = false; - + battery.sendInternalVoltage = false; battery.monitorInternalVoltage = false; battery.internalSleepVoltage = 2.9; diff --git a/src/display.cpp b/src/display.cpp index a9cdaf8..ba5c577 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -1,17 +1,17 @@ /* Copyright (C) 2025 Ricardo Guzman - CA2RXU - * + * * This file is part of LoRa APRS iGate. - * + * * LoRa APRS iGate is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * LoRa APRS iGate is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with LoRa APRS iGate. If not, see . */ @@ -26,7 +26,7 @@ #ifdef HAS_TFT #include - TFT_eSPI tft = TFT_eSPI(); + TFT_eSPI tft = TFT_eSPI(); TFT_eSprite sprite = TFT_eSprite(&tft); #ifdef HELTEC_WIRELESS_TRACKER @@ -176,7 +176,7 @@ void displayToggle(bool toggle) { #else if (displayFound) display.ssd1306_command(SSD1306_DISPLAYOFF); #endif - + #endif #endif } diff --git a/src/mqtt_utils.cpp b/src/mqtt_utils.cpp index 0ccad61..7793962 100644 --- a/src/mqtt_utils.cpp +++ b/src/mqtt_utils.cpp @@ -1,17 +1,17 @@ /* Copyright (C) 2025 Ricardo Guzman - CA2RXU - * + * * This file is part of LoRa APRS iGate. - * + * * LoRa APRS iGate is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * LoRa APRS iGate is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with LoRa APRS iGate. If not, see . */ @@ -95,7 +95,7 @@ namespace MQTT_Utils { void setup() { if (!Config.mqtt.active) return; pubSub.setClient(mqttClient); - pubSub.setCallback(receivedFromMqtt); + pubSub.setCallback(receivedFromMqtt); } } \ No newline at end of file diff --git a/src/ntp_utils.cpp b/src/ntp_utils.cpp index c069a90..b835384 100644 --- a/src/ntp_utils.cpp +++ b/src/ntp_utils.cpp @@ -1,17 +1,17 @@ /* Copyright (C) 2025 Ricardo Guzman - CA2RXU - * + * * This file is part of LoRa APRS iGate. - * + * * LoRa APRS iGate is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * LoRa APRS iGate is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with LoRa APRS iGate. If not, see . */ diff --git a/src/ota_utils.cpp b/src/ota_utils.cpp index 6195600..abb1ba8 100644 --- a/src/ota_utils.cpp +++ b/src/ota_utils.cpp @@ -1,17 +1,17 @@ /* Copyright (C) 2025 Ricardo Guzman - CA2RXU - * + * * This file is part of LoRa APRS iGate. - * + * * LoRa APRS iGate is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * LoRa APRS iGate is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with LoRa APRS iGate. If not, see . */ diff --git a/src/tnc_utils.cpp b/src/tnc_utils.cpp index d23e6cc..8de1bca 100644 --- a/src/tnc_utils.cpp +++ b/src/tnc_utils.cpp @@ -1,17 +1,17 @@ /* Copyright (C) 2025 Ricardo Guzman - CA2RXU - * + * * This file is part of LoRa APRS iGate. - * + * * LoRa APRS iGate is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * LoRa APRS iGate is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with LoRa APRS iGate. If not, see . */ @@ -45,7 +45,7 @@ String inputSerialBuffer = ""; namespace TNC_Utils { - + void setup() { if (Config.tnc.enableServer && Config.digi.ecoMode == 0) { tncServer.stop(); diff --git a/src/web_utils.cpp b/src/web_utils.cpp index 9a99e2c..6197b37 100644 --- a/src/web_utils.cpp +++ b/src/web_utils.cpp @@ -1,17 +1,17 @@ /* Copyright (C) 2025 Ricardo Guzman - CA2RXU - * + * * This file is part of LoRa APRS iGate. - * + * * LoRa APRS iGate is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * LoRa APRS iGate is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with LoRa APRS iGate. If not, see . */ @@ -88,7 +88,7 @@ namespace WEB_Utils { return request->requestAuthentication(); File file = SPIFFS.open("/igate_conf.json"); - + String fileContent; while(file.available()){ fileContent += String((char)file.read()); @@ -161,7 +161,7 @@ namespace WEB_Utils { Config.callsign = getParamStringSafe("callsign", Config.callsign); Config.tacticalCallsign = getParamStringSafe("tacticalCallsign", Config.tacticalCallsign); - + Config.wifiAutoAP.password = getParamStringSafe("wifi.autoAP.password", Config.wifiAutoAP.password); Config.wifiAutoAP.timeout = getParamIntSafe("wifi.autoAP.timeout", Config.wifiAutoAP.timeout); @@ -299,7 +299,7 @@ namespace WEB_Utils { AsyncWebServerResponse *response = request->beginResponse(302, "text/html", ""); response->addHeader("Location", "/?success=1"); request->send(response); - + displayToggle(false); delay(500); ESP.restart(); @@ -309,7 +309,7 @@ namespace WEB_Utils { errorPage += "

Configuration Error:

"; errorPage += "

Couldn't save new configuration. Please try again.

"; errorPage += "Back"; - + AsyncWebServerResponse *response = request->beginResponse(500, "text/html", errorPage); request->send(response); } diff --git a/src/wifi_utils.cpp b/src/wifi_utils.cpp index b6f5672..2781f17 100644 --- a/src/wifi_utils.cpp +++ b/src/wifi_utils.cpp @@ -1,17 +1,17 @@ /* Copyright (C) 2025 Ricardo Guzman - CA2RXU - * + * * This file is part of LoRa APRS iGate. - * + * * LoRa APRS iGate is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * LoRa APRS iGate is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with LoRa APRS iGate. If not, see . */ @@ -66,7 +66,7 @@ namespace WIFI_Utils { backupDigiMode = true; WiFi.disconnect(); lastBackupDigiTime = currentTime; - } + } } else { Serial.println("Reconnecting to WiFi..."); WiFi.disconnect();