LoRa_APRS_Tracker/src/configuration.h

72 lines
1.3 KiB
C
Raw Normal View History

2021-03-03 20:58:31 +00:00
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_
#include <list>
#include <Arduino.h>
class Configuration
{
public:
class Beacon
{
public:
Beacon() : message("LoRa Tracker, Info: github.com/lora-aprs/LoRa_APRS_Tracker"), timeout(1), symbol("["), overlay("/") {}
2021-03-03 20:58:31 +00:00
String message;
int timeout;
String symbol;
String overlay;
2021-03-05 14:01:07 +00:00
};
class Smart_Beacon
{
public:
Smart_Beacon() : active(false), turn_min(25), slow_rate(300), slow_speed(10), fast_rate(60), fast_speed(100), min_tx_dist(100), min_bcn(5) {}
2021-03-05 14:01:07 +00:00
bool active;
int turn_min;
2021-03-05 14:01:07 +00:00
int slow_rate;
int slow_speed;
int fast_rate;
int fast_speed;
int min_tx_dist;
int min_bcn;
2021-03-03 20:58:31 +00:00
};
class LoRa
{
public:
LoRa() : frequencyRx(433775000), frequencyTx(433775000), power(20), spreadingFactor(12), signalBandwidth(125000), codingRate4(5) {}
2021-03-03 20:58:31 +00:00
long frequencyRx;
long frequencyTx;
int power;
int spreadingFactor;
long signalBandwidth;
int codingRate4;
};
Configuration() : callsign("NOCALL-10"), debug(false) {};
2021-03-03 20:58:31 +00:00
String callsign;
bool debug;
2021-03-03 20:58:31 +00:00
Beacon beacon;
2021-03-05 14:01:07 +00:00
Smart_Beacon smart_beacon;
2021-03-03 20:58:31 +00:00
LoRa lora;
};
class ConfigurationManagement
{
public:
explicit ConfigurationManagement(String FilePath);
Configuration readConfiguration();
void writeConfiguration(Configuration conf);
private:
const String mFilePath;
};
#endif