LoRa_APRS_iGate/include/configuration.h

206 lines
4.3 KiB
C
Raw Permalink Normal View History

2025-07-15 22:28:23 +02:00
/* 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
* (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 <https://www.gnu.org/licenses/>.
*/
2023-06-06 17:21:59 +02:00
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_
#include <Arduino.h>
#include <vector>
2023-06-08 06:58:10 +02:00
#include <FS.h>
2023-06-06 17:21:59 +02:00
2024-11-06 16:47:42 +01:00
2023-06-06 17:21:59 +02:00
class WiFi_AP {
public:
2024-02-24 14:09:05 +01:00
String ssid;
String password;
2023-06-09 01:31:27 +02:00
};
2024-02-24 14:09:05 +01:00
class WiFi_Auto_AP {
public:
String password;
2024-10-07 03:30:44 +02:00
int timeout;
2024-02-24 14:09:05 +01:00
};
2024-05-24 02:13:05 +02:00
class BEACON {
2024-03-07 17:46:38 +01:00
public:
2024-05-24 01:27:10 +02:00
double latitude;
double longitude;
String comment;
int interval;
String overlay;
String symbol;
String path;
bool sendViaAPRSIS;
2025-10-15 15:58:30 +02:00
bool sendViaRF;
2025-10-15 19:18:43 +02:00
int beaconFreq;
2025-08-18 04:04:22 +02:00
bool statusActive;
String statusPacket;
2025-10-15 15:58:30 +02:00
bool gpsActive;
2025-11-30 14:15:01 +01:00
int ambiguityLevel;
2023-06-06 17:21:59 +02:00
};
class APRS_IS {
public:
2024-05-24 01:27:10 +02:00
bool active;
2024-02-24 14:09:05 +01:00
String passcode;
String server;
int port;
2024-05-24 01:27:10 +02:00
String filter;
2024-05-20 23:57:58 +02:00
bool messagesToRF;
bool objectsToRF;
2023-06-06 17:21:59 +02:00
};
2024-05-24 01:27:10 +02:00
class DIGI {
public:
int mode;
2025-10-15 15:58:30 +02:00
int ecoMode; // 0 = Not Active | 1 = Ultra EcoMode | 2 = Not Active (WiFi OFF, Serial ON)
2024-05-24 01:27:10 +02:00
};
2023-06-06 17:21:59 +02:00
class LoraModule {
public:
2025-10-13 06:33:41 +02:00
bool rxActive;
2024-05-24 01:27:10 +02:00
long rxFreq;
2025-10-13 06:33:41 +02:00
int rxSpreadingFactor;
int rxCodingRate4;
long rxSignalBandwidth;
2024-05-24 01:27:10 +02:00
bool txActive;
2025-10-13 06:33:41 +02:00
long txFreq;
int txSpreadingFactor;
int txCodingRate4;
long txSignalBandwidth;
2024-02-24 14:09:05 +01:00
int power;
2023-06-06 17:21:59 +02:00
};
class Display {
public:
2024-02-24 14:09:05 +01:00
bool alwaysOn;
int timeout;
bool turn180;
2023-06-06 17:21:59 +02:00
};
2024-05-24 02:13:05 +02:00
class BATTERY {
public:
2024-05-24 04:52:17 +02:00
bool sendInternalVoltage;
2024-05-24 16:43:06 +02:00
bool monitorInternalVoltage;
float internalSleepVoltage;
2024-05-24 04:52:17 +02:00
bool sendExternalVoltage;
2024-05-24 02:13:05 +02:00
int externalVoltagePin;
2024-05-24 16:43:06 +02:00
bool monitorExternalVoltage;
float externalSleepVoltage;
2025-12-01 16:45:14 +01:00
bool useExternalI2CSensor;
2024-06-26 23:10:07 +02:00
float voltageDividerR1;
float voltageDividerR2;
2024-09-22 18:34:13 +02:00
bool sendVoltageAsTelemetry;
2024-05-24 02:13:05 +02:00
};
2024-10-05 13:48:08 +02:00
class WXSENSOR {
2024-03-17 12:21:11 +01:00
public:
2024-05-24 01:27:10 +02:00
bool active;
int heightCorrection;
float temperatureCorrection;
2024-03-17 12:21:11 +01:00
};
class SYSLOG {
public:
2024-02-24 14:09:05 +01:00
bool active;
String server;
int port;
2025-08-20 18:32:05 +02:00
bool logBeaconOverTCPIP;
};
2024-05-24 01:27:10 +02:00
class TNC {
2023-06-18 00:28:40 +02:00
public:
2024-05-24 01:27:10 +02:00
bool enableServer;
bool enableSerial;
bool acceptOwn;
2025-10-15 20:11:07 +02:00
bool aprsBridgeActive;
2023-06-18 00:28:40 +02:00
};
2023-08-29 04:08:00 +02:00
class OTA {
public:
2024-02-24 14:09:05 +01:00
String username;
String password;
2023-08-29 04:08:00 +02:00
};
2024-08-13 20:48:08 +02:00
class WEBADMIN {
public:
bool active;
String username;
String password;
};
2024-10-14 16:44:22 +02:00
class NTP {
public:
2025-10-11 17:40:07 +02:00
String server;
2025-01-02 16:20:18 +01:00
float gmtCorrection;
2024-10-14 16:44:22 +02:00
};
2025-03-09 14:23:34 +01:00
class REMOTE_MANAGEMENT {
public:
String managers;
bool rfOnly;
};
2024-10-14 16:44:22 +02:00
2025-08-27 19:25:11 +02:00
class MQTT {
public:
bool active;
String server;
String topic;
String username;
String password;
int port;
2025-10-11 18:22:08 +02:00
bool beaconOverMqtt;
2025-08-27 19:25:11 +02:00
};
2023-06-06 17:21:59 +02:00
class Configuration {
public:
2024-05-24 01:27:10 +02:00
String callsign;
2024-05-22 22:19:45 +02:00
int rememberStationTime;
bool backupDigiMode;
2024-05-23 01:19:25 +02:00
bool rebootMode;
int rebootModeTime;
2025-10-12 19:21:51 +02:00
int startupDelay;
2024-06-26 19:05:45 +02:00
String personalNote;
2025-03-09 14:23:34 +01:00
String blacklist;
2024-05-22 22:19:45 +02:00
std::vector<WiFi_AP> wifiAPs;
WiFi_Auto_AP wifiAutoAP;
2024-05-24 02:13:05 +02:00
BEACON beacon;
2024-05-22 22:19:45 +02:00
APRS_IS aprs_is;
2024-05-24 02:13:05 +02:00
DIGI digi;
2024-05-22 22:19:45 +02:00
LoraModule loramodule;
Display display;
2024-05-24 02:13:05 +02:00
BATTERY battery;
2024-10-05 13:48:08 +02:00
WXSENSOR wxsensor;
2024-05-24 02:13:05 +02:00
SYSLOG syslog;
TNC tnc;
2024-05-22 22:19:45 +02:00
OTA ota;
2024-08-13 20:48:08 +02:00
WEBADMIN webadmin;
2025-03-09 14:23:34 +01:00
NTP ntp;
REMOTE_MANAGEMENT remoteManagement;
2025-08-27 19:25:11 +02:00
MQTT mqtt;
2025-05-18 14:44:46 +02:00
2025-09-17 22:00:49 +02:00
void setDefaultValues();
2025-09-17 19:29:37 +02:00
bool writeFile();
2024-02-24 14:09:05 +01:00
Configuration();
2023-06-06 17:21:59 +02:00
private:
2024-02-24 14:09:05 +01:00
bool readFile();
String _filePath;
2023-06-06 17:21:59 +02:00
};
2024-02-24 14:09:05 +01:00
2023-06-06 17:21:59 +02:00
#endif