LoRa_APRS_iGate/src/project_configuration.h

133 wiersze
2.4 KiB
C
Czysty Zwykły widok Historia

#ifndef PROJECT_CONFIGURATION_H_
#define PROJECT_CONFIGURATION_H_
#include <BoardFinder.h>
#include <configuration.h>
class Configuration {
public:
class NETWORK {
2021-07-15 14:36:33 +00:00
public:
NETWORK() : DHCP(true) {
2021-07-15 14:36:33 +00:00
}
bool DHCP;
IPAddress staticIP;
IPAddress subnet;
IPAddress gateway;
IPAddress dns;
2021-07-15 14:36:33 +00:00
};
class Wifi {
public:
class AP {
public:
String SSID;
String password;
};
Wifi() {
}
std::list<AP> APs;
};
class Beacon {
public:
Beacon() : message("LoRa iGATE & Digi, Info: github.com/peterus/LoRa_APRS_iGate"), positionLatitude(0.0), positionLongitude(0.0), timeout(15) {
}
String message;
double positionLatitude;
double positionLongitude;
int timeout;
};
class APRS_IS {
public:
2021-05-24 12:22:16 +00:00
APRS_IS() : active(true), server("euro.aprs2.net"), port(14580) {
}
2021-05-25 11:00:44 +00:00
bool active;
String passcode;
String server;
int port;
};
class Digi {
public:
2021-05-25 19:57:18 +00:00
Digi() : active(false), beacon(true) {
}
bool active;
bool beacon;
};
class LoRa {
public:
LoRa() : frequencyRx(433775000), frequencyTx(433775000), power(20), spreadingFactor(12), signalBandwidth(125000), codingRate4(5) {
}
long frequencyRx;
long frequencyTx;
int power;
int spreadingFactor;
long signalBandwidth;
int codingRate4;
};
class Display {
public:
Display() : alwaysOn(true), timeout(10), overwritePin(0), turn180(true) {
}
bool alwaysOn;
int timeout;
int overwritePin;
bool turn180;
};
class Ftp {
public:
class User {
public:
String name;
String password;
};
Ftp() : active(false) {
}
bool active;
std::list<User> users;
};
Configuration() : callsign("NOCALL-10"), board(""), ntpServer("pool.ntp.org"){};
String callsign;
NETWORK network;
Wifi wifi;
Beacon beacon;
APRS_IS aprs_is;
Digi digi;
LoRa lora;
Display display;
Ftp ftp;
String board;
String ntpServer;
};
class ProjectConfigurationManagement : public ConfigurationManagement {
public:
explicit ProjectConfigurationManagement() : ConfigurationManagement("/is-cfg.json") {
}
virtual ~ProjectConfigurationManagement() {
}
private:
2021-05-18 22:44:37 +00:00
virtual void readProjectConfiguration(DynamicJsonDocument &data, Configuration &conf) override;
virtual void writeProjectConfiguration(Configuration &conf, DynamicJsonDocument &data) override;
};
#endif