mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-03-28 16:52:33 +01:00
kill white spaces
This commit is contained in:
@@ -8,10 +8,10 @@ namespace APRS_IS_Utils {
|
||||
|
||||
void upload(const String& line);
|
||||
void connect();
|
||||
|
||||
|
||||
void checkStatus();
|
||||
String checkForStartingBytes(const String& packet);
|
||||
|
||||
|
||||
String buildPacketToUpload(const String& packet);
|
||||
bool processReceivedLoRaMessage(const String& sender, const String& packet, bool thirdParty);
|
||||
void processLoRaPacket(const String& packet);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BATTERY_Utils {
|
||||
|
||||
void adcCalibration();
|
||||
void adcCalibrationCheck();
|
||||
|
||||
|
||||
void setup();
|
||||
float checkInternalVoltage();
|
||||
float checkExternalVoltage();
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
WEBADMIN webadmin;
|
||||
NTP ntp;
|
||||
REMOTE_MANAGEMENT remoteManagement;
|
||||
|
||||
|
||||
void init();
|
||||
void writeFile();
|
||||
Configuration();
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace LoRa_Utils {
|
||||
void changeFreqTx();
|
||||
void changeFreqRx();
|
||||
void wakeRadio();
|
||||
//void startReceive();
|
||||
void sleepRadio();
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace TNC_Utils {
|
||||
|
||||
void setup();
|
||||
void loop();
|
||||
|
||||
|
||||
void sendToClients(const String& packet);
|
||||
void sendToSerial(const String& packet);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace WIFI_Utils {
|
||||
void startWiFi();
|
||||
void checkAutoAPTimeout();
|
||||
void setup();
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -129,7 +129,7 @@
|
||||
delayATMessage = 0;
|
||||
} else if (ATMessage.indexOf(Config.callsign) >= 3 && !modemLoggedToAPRSIS && response.indexOf("OK") >= 0 && !stationBeacon) { // login info
|
||||
validAT = true;
|
||||
delayATMessage = 0;
|
||||
delayATMessage = 0;
|
||||
} else if (ATMessage.indexOf(Config.callsign) == 0 && !beaconSended && response.indexOf("OK") >= 0 && !stationBeacon) { // self beacon or querys
|
||||
validAT = true;
|
||||
i = 1;
|
||||
@@ -203,4 +203,5 @@
|
||||
delay(1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@ uint32_t lastRxTime = millis();
|
||||
bool passcodeValid = false;
|
||||
|
||||
#ifdef HAS_A7670
|
||||
extern bool stationBeacon;
|
||||
extern bool stationBeacon;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace APRS_IS_Utils {
|
||||
wifiState = "--";
|
||||
} else {
|
||||
wifiState = "AP";
|
||||
}
|
||||
}
|
||||
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
|
||||
displayToggle(true);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace APRS_IS_Utils {
|
||||
ackMessage.concat(packet.substring(packet.indexOf("{") + 1));
|
||||
ackMessage.trim();
|
||||
//Serial.println(ackMessage);
|
||||
|
||||
|
||||
String addToBuffer = Config.callsign;
|
||||
addToBuffer += ">APLRG1";
|
||||
if (!thirdParty) addToBuffer += ",RFONLY";
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace DIGI_Utils {
|
||||
}
|
||||
}
|
||||
|
||||
void processLoRaPacket(const String& packet) {
|
||||
void processLoRaPacket(const String& packet) {
|
||||
if (packet.indexOf("NOGATE") == -1) {
|
||||
bool thirdPartyPacket = false;
|
||||
String temp, Sender;
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
extern Configuration Config;
|
||||
|
||||
bool displayFound = false;
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace GPS_Utils {
|
||||
}
|
||||
generateBeaconFirstPart();
|
||||
String encodedGPS = encodeGPS(Config.beacon.latitude, Config.beacon.longitude, Config.beacon.overlay, Config.beacon.symbol);
|
||||
iGateBeaconPacket += encodedGPS;
|
||||
iGateBeaconPacket += encodedGPS;
|
||||
iGateLoRaBeaconPacket += encodedGPS;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace LoRa_Utils {
|
||||
}
|
||||
} else {
|
||||
packet = "";
|
||||
}
|
||||
}
|
||||
lastRxTime = millis();
|
||||
return packet;
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@ unsigned long ota_progress_millis = 0;
|
||||
|
||||
|
||||
namespace OTA_Utils {
|
||||
|
||||
|
||||
void setup(AsyncWebServer *server) {
|
||||
if (Config.ota.username != "" && Config.ota.password != "") {
|
||||
ElegantOTA.begin(server, Config.ota.username.c_str(), Config.ota.password.c_str());
|
||||
} else {
|
||||
ElegantOTA.begin(server);
|
||||
}
|
||||
|
||||
|
||||
ElegantOTA.setAutoReboot(true);
|
||||
ElegantOTA.onStart(onOTAStart);
|
||||
ElegantOTA.onProgress(onOTAProgress);
|
||||
@@ -55,8 +55,8 @@ namespace OTA_Utils {
|
||||
|
||||
Serial.println(success ? "OTA update finished successfully!" : "There was an error during OTA update!");
|
||||
displayShow("", "", statusMessage, "", rebootMessage, "", "", 4000);
|
||||
|
||||
|
||||
isUpdatingOTA = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -232,7 +232,7 @@ namespace POWER_Utils {
|
||||
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? HIGH : LOW);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_GPS
|
||||
if (Config.beacon.gpsActive && Config.digi.ecoMode != 1) activateGPS();
|
||||
#endif
|
||||
@@ -274,7 +274,7 @@ namespace POWER_Utils {
|
||||
delay(500);
|
||||
Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
|
||||
#endif
|
||||
|
||||
|
||||
delay(1000);
|
||||
BATTERY_Utils::setup();
|
||||
BATTERY_Utils::startupBatteryHealth();
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace QUERY_Utils {
|
||||
Config.writeFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (answer == "") return "";
|
||||
|
||||
String queryAnswer = Config.callsign;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace SLEEP_Utils {
|
||||
wakeUpFlag = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void setup() {
|
||||
if (Config.digi.ecoMode == 1) {
|
||||
pinMode(RADIO_WAKEUP_PIN, INPUT);
|
||||
@@ -56,7 +56,6 @@ namespace SLEEP_Utils {
|
||||
LoRa_Utils::wakeRadio();
|
||||
esp_light_sleep_start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void checkSerial() {
|
||||
|
||||
@@ -58,10 +58,10 @@ namespace STATION_Utils {
|
||||
if (callsign.startsWith(wildcard)) return true;
|
||||
} else {
|
||||
if (list[i] == callsign) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool isBlacklisted(const String& callsign) {
|
||||
return checkCallsignList(blacklist, callsign);
|
||||
@@ -94,7 +94,7 @@ namespace STATION_Utils {
|
||||
lastHeardObjects.emplace_back(LastHeardStation{millis(), object}); // Add new object and Tx
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void deleteNotHeard() {
|
||||
std::vector<LastHeardStation> lastHeardStation_temp;
|
||||
for (int i = 0; i < lastHeardStations.size(); i++) {
|
||||
@@ -149,13 +149,13 @@ namespace STATION_Utils {
|
||||
return true;
|
||||
}
|
||||
|
||||
void processOutputPacketBufferUltraEcoMode() {
|
||||
void processOutputPacketBufferUltraEcoMode() {
|
||||
size_t currentIndex = 0;
|
||||
while (currentIndex < outputPacketBuffer.size()) { // this sends all packets from output buffer
|
||||
delay(3000); // and cleans buffer to avoid sending packets with time offset
|
||||
LoRa_Utils::sendNewPacket(outputPacketBuffer[currentIndex]); // next time it wakes up
|
||||
currentIndex++;
|
||||
}
|
||||
}
|
||||
outputPacketBuffer.clear();
|
||||
//
|
||||
if (saveNewDigiEcoModeConfig) {
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace SYSLOG_Utils {
|
||||
String syslogPacket = "<165>1 - ";
|
||||
syslogPacket.concat(Config.callsign);
|
||||
syslogPacket.concat(" CA2RXU_LoRa_iGate_3.0 - - - "); //RFC5424 The Syslog Protocol
|
||||
|
||||
|
||||
char signalData[35];
|
||||
snprintf(signalData, sizeof(signalData), " / %ddBm / %.2fdB / %dHz", rssi, snr, freqError);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace TNC_Utils {
|
||||
void handleInputData(char character, int bufferIndex) {
|
||||
String* data = (bufferIndex == -1) ? &inputSerialBuffer : &inputServerBuffer[bufferIndex];
|
||||
if (data->length() == 0 && character != (char)FEND) return;
|
||||
|
||||
|
||||
data->concat(character);
|
||||
|
||||
if (character == (char)FEND && data->length() > 3) {
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace Utils {
|
||||
void checkBeaconInterval() {
|
||||
uint32_t lastTx = millis() - lastBeaconTx;
|
||||
if (lastBeaconTx == 0 || lastTx >= Config.beacon.interval * 60 * 1000) {
|
||||
beaconUpdate = true;
|
||||
beaconUpdate = true;
|
||||
}
|
||||
|
||||
#ifdef HAS_GPS
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace WEB_Utils {
|
||||
|
||||
Config.wifiAutoAP.password = request->getParam("wifi.autoAP.password", true)->value();
|
||||
Config.wifiAutoAP.timeout = request->getParam("wifi.autoAP.timeout", true)->value().toInt();
|
||||
|
||||
|
||||
|
||||
Config.aprs_is.active = request->hasParam("aprs_is.active", true);
|
||||
Config.aprs_is.passcode = request->getParam("aprs_is.passcode", true)->value();
|
||||
@@ -175,7 +175,7 @@ namespace WEB_Utils {
|
||||
Config.battery.externalSleepVoltage = request->getParam("battery.externalSleepVoltage", true)->value().toFloat();
|
||||
|
||||
Config.battery.sendVoltageAsTelemetry = request->hasParam("battery.sendVoltageAsTelemetry", true);
|
||||
|
||||
|
||||
Config.wxsensor.active = request->hasParam("wxsensor.active", true);
|
||||
Config.wxsensor.heightCorrection = request->getParam("wxsensor.heightCorrection", true)->value().toInt();
|
||||
Config.wxsensor.temperatureCorrection = request->getParam("wxsensor.temperatureCorrection", true)->value().toFloat();
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace WX_Utils {
|
||||
|
||||
void setup() {
|
||||
if (Config.wxsensor.active) {
|
||||
getWxModuleAddres();
|
||||
getWxModuleAddres();
|
||||
if (wxModuleAddress != 0x00) {
|
||||
bool wxModuleFound = false;
|
||||
if (wxModuleAddress == 0x76 || wxModuleAddress == 0x77) {
|
||||
|
||||
Reference in New Issue
Block a user