LoRa_APRS_iGate/include/configuration.h

165 lines
3.1 KiB
C
Raw Normal View History

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 sendViaRF;
bool sendViaAPRSIS;
2024-10-14 22:04:28 +02:00
bool gpsActive;
bool gpsAmbiguity;
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-04-24 14:07:29 +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:
2024-05-24 01:27:10 +02:00
long txFreq;
long rxFreq;
bool txActive;
bool rxActive;
2024-02-24 14:09:05 +01:00
int spreadingFactor;
long signalBandwidth;
int codingRate4;
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;
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;
};
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;
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-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
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;
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-05-18 14:44:46 +02:00
2024-02-24 14:09:05 +01:00
void init();
void writeFile();
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