2023-06-06 11:21:59 -04:00
|
|
|
#ifndef CONFIGURATION_H_
|
|
|
|
|
#define CONFIGURATION_H_
|
|
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <vector>
|
2023-06-08 00:58:10 -04:00
|
|
|
#include <FS.h>
|
2023-06-06 11:21:59 -04:00
|
|
|
|
|
|
|
|
class WiFi_AP {
|
|
|
|
|
public:
|
2024-02-24 14:09:05 +01:00
|
|
|
String ssid;
|
|
|
|
|
String password;
|
2023-06-08 19:31:27 -04:00
|
|
|
};
|
|
|
|
|
|
2024-02-24 14:09:05 +01:00
|
|
|
class WiFi_Auto_AP {
|
|
|
|
|
public:
|
|
|
|
|
String password;
|
|
|
|
|
int powerOff;
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-23 20:13:05 -04:00
|
|
|
class BEACON {
|
2024-03-07 17:46:38 +01:00
|
|
|
public:
|
2024-05-23 19:27:10 -04:00
|
|
|
double latitude;
|
|
|
|
|
double longitude;
|
|
|
|
|
String comment;
|
|
|
|
|
int interval;
|
|
|
|
|
String overlay;
|
|
|
|
|
String symbol;
|
|
|
|
|
String path;
|
|
|
|
|
bool sendViaRF;
|
|
|
|
|
bool sendViaAPRSIS;
|
2023-06-06 11:21:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class APRS_IS {
|
|
|
|
|
public:
|
2024-05-23 19:27:10 -04:00
|
|
|
bool active;
|
2024-02-24 14:09:05 +01:00
|
|
|
String passcode;
|
|
|
|
|
String server;
|
|
|
|
|
int port;
|
2024-05-23 19:27:10 -04:00
|
|
|
String filter;
|
2024-05-20 17:57:58 -04:00
|
|
|
bool messagesToRF;
|
|
|
|
|
bool objectsToRF;
|
2023-06-06 11:21:59 -04:00
|
|
|
};
|
|
|
|
|
|
2024-05-23 19:27:10 -04:00
|
|
|
class DIGI {
|
|
|
|
|
public:
|
|
|
|
|
int mode;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 11:21:59 -04:00
|
|
|
class LoraModule {
|
|
|
|
|
public:
|
2024-05-23 19:27:10 -04: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 11:21:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class Display {
|
|
|
|
|
public:
|
2024-02-24 14:09:05 +01:00
|
|
|
bool alwaysOn;
|
|
|
|
|
int timeout;
|
|
|
|
|
bool turn180;
|
2023-06-06 11:21:59 -04:00
|
|
|
};
|
|
|
|
|
|
2024-05-23 20:13:05 -04:00
|
|
|
class BATTERY {
|
|
|
|
|
public:
|
2024-05-23 22:52:17 -04:00
|
|
|
bool sendInternalVoltage;
|
2024-05-24 10:43:06 -04:00
|
|
|
bool monitorInternalVoltage;
|
|
|
|
|
float internalSleepVoltage;
|
2024-05-23 22:52:17 -04:00
|
|
|
bool sendExternalVoltage;
|
2024-05-23 20:13:05 -04:00
|
|
|
int externalVoltagePin;
|
2024-05-24 10:43:06 -04:00
|
|
|
bool monitorExternalVoltage;
|
|
|
|
|
float externalSleepVoltage;
|
2024-06-26 17:10:07 -04:00
|
|
|
float voltageDividerR1;
|
|
|
|
|
float voltageDividerR2;
|
2024-05-23 20:13:05 -04:00
|
|
|
};
|
|
|
|
|
|
2024-05-23 19:27:10 -04:00
|
|
|
class BME {
|
2024-03-17 12:21:11 +01:00
|
|
|
public:
|
2024-05-23 19:27:10 -04:00
|
|
|
bool active;
|
|
|
|
|
int heightCorrection;
|
|
|
|
|
float temperatureCorrection;
|
2024-03-17 12:21:11 +01:00
|
|
|
};
|
|
|
|
|
|
2023-06-11 23:21:52 -04:00
|
|
|
class SYSLOG {
|
|
|
|
|
public:
|
2024-02-24 14:09:05 +01:00
|
|
|
bool active;
|
|
|
|
|
String server;
|
|
|
|
|
int port;
|
2023-06-11 23:21:52 -04:00
|
|
|
};
|
|
|
|
|
|
2024-05-23 19:27:10 -04:00
|
|
|
class TNC {
|
2023-06-17 18:28:40 -04:00
|
|
|
public:
|
2024-05-23 19:27:10 -04:00
|
|
|
bool enableServer;
|
|
|
|
|
bool enableSerial;
|
|
|
|
|
bool acceptOwn;
|
2023-06-17 18:28:40 -04:00
|
|
|
};
|
|
|
|
|
|
2023-08-28 22:08:00 -04:00
|
|
|
class OTA {
|
|
|
|
|
public:
|
2024-02-24 14:09:05 +01:00
|
|
|
String username;
|
|
|
|
|
String password;
|
2023-08-28 22:08:00 -04:00
|
|
|
};
|
|
|
|
|
|
2024-08-13 14:48:08 -04:00
|
|
|
class WEBADMIN {
|
|
|
|
|
public:
|
|
|
|
|
bool active;
|
|
|
|
|
String username;
|
|
|
|
|
String password;
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-06 11:21:59 -04:00
|
|
|
class Configuration {
|
|
|
|
|
public:
|
2024-05-23 19:27:10 -04:00
|
|
|
String callsign;
|
2024-05-22 16:19:45 -04:00
|
|
|
int rememberStationTime;
|
|
|
|
|
bool lowPowerMode;
|
|
|
|
|
double lowVoltageCutOff;
|
|
|
|
|
bool backupDigiMode;
|
2024-05-22 19:19:25 -04:00
|
|
|
bool rebootMode;
|
|
|
|
|
int rebootModeTime;
|
2024-06-26 13:05:45 -04:00
|
|
|
String personalNote;
|
2024-05-22 16:19:45 -04:00
|
|
|
std::vector<WiFi_AP> wifiAPs;
|
|
|
|
|
WiFi_Auto_AP wifiAutoAP;
|
2024-05-23 20:13:05 -04:00
|
|
|
BEACON beacon;
|
2024-05-22 16:19:45 -04:00
|
|
|
APRS_IS aprs_is;
|
2024-05-23 20:13:05 -04:00
|
|
|
DIGI digi;
|
2024-05-22 16:19:45 -04:00
|
|
|
LoraModule loramodule;
|
|
|
|
|
Display display;
|
2024-05-23 20:13:05 -04:00
|
|
|
BATTERY battery;
|
2024-05-22 16:19:45 -04:00
|
|
|
BME bme;
|
2024-05-23 20:13:05 -04:00
|
|
|
SYSLOG syslog;
|
|
|
|
|
TNC tnc;
|
2024-05-22 16:19:45 -04:00
|
|
|
OTA ota;
|
2024-08-13 14:48:08 -04:00
|
|
|
WEBADMIN webadmin;
|
2023-06-06 11:21:59 -04:00
|
|
|
|
2024-02-24 14:09:05 +01:00
|
|
|
void init();
|
|
|
|
|
void writeFile();
|
|
|
|
|
Configuration();
|
2023-06-06 11:21:59 -04:00
|
|
|
|
|
|
|
|
private:
|
2024-02-24 14:09:05 +01:00
|
|
|
bool readFile();
|
|
|
|
|
String _filePath;
|
2023-06-06 11:21:59 -04:00
|
|
|
};
|
2024-02-24 14:09:05 +01:00
|
|
|
|
2023-06-06 11:21:59 -04:00
|
|
|
#endif
|