mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-22 17:57:32 +00:00
More sfpp config
This commit is contained in:
@@ -790,8 +790,12 @@ bool loadConfig(const char *configPath)
|
||||
|
||||
if (yamlConfig["StoreAndForward"]) {
|
||||
portduino_config.sfpp_stratum0 = (yamlConfig["StoreAndForward"]["Stratum0"]).as<bool>(false);
|
||||
portduino_config.sfpp_enabled = (yamlConfig["StoreAndForward"]["Enabled"]).as<bool>(true);
|
||||
portduino_config.sfpp_db_path = (yamlConfig["StoreAndForward"]["DBPath"]).as<std::string>("/var/lib/meshtasticd/");
|
||||
portduino_config.sfpp_initial_sync = (yamlConfig["StoreAndForward"]["InitialSync"]).as<int>(10);
|
||||
portduino_config.sfpp_hops = (yamlConfig["StoreAndForward"]["Hops"]).as<int>(3);
|
||||
portduino_config.sfpp_announce_interval = (yamlConfig["StoreAndForward"]["AnnounceInterval"]).as<int>(5);
|
||||
portduino_config.sfpp_max_chain = (yamlConfig["StoreAndForward"]["MaxChain"]).as<uint32_t>(1000);
|
||||
}
|
||||
|
||||
if (yamlConfig["General"]) {
|
||||
|
||||
@@ -173,6 +173,7 @@ extern struct portduino_config_struct {
|
||||
// DB location /var/lib/meshtasticd/
|
||||
std::string sfpp_db_path = "/var/lib/meshtasticd/";
|
||||
bool sfpp_stratum0 = false;
|
||||
bool sfpp_enabled = true;
|
||||
int sfpp_initial_sync = 10;
|
||||
int sfpp_hops = 3;
|
||||
int sfpp_announce_interval = 5; // minutes
|
||||
@@ -502,9 +503,10 @@ extern struct portduino_config_struct {
|
||||
}
|
||||
|
||||
// StoreAndForward
|
||||
if (sfpp_stratum0 || sfpp_initial_sync != 10 || sfpp_hops != 3 || sfpp_announce_interval != 5 || sfpp_max_chain != 1000) {
|
||||
if (sfpp_enabled) {
|
||||
out << YAML::Key << "StoreAndForward" << YAML::Value << YAML::BeginMap;
|
||||
|
||||
out << YAML::Key << "Enabled" << YAML::Value << sfpp_enabled;
|
||||
out << YAML::Key << "DBPath" << YAML::Value << sfpp_db_path;
|
||||
out << YAML::Key << "Stratum0" << YAML::Value << sfpp_stratum0;
|
||||
out << YAML::Key << "InitialSync" << YAML::Value << sfpp_initial_sync;
|
||||
out << YAML::Key << "Hops" << YAML::Value << sfpp_hops;
|
||||
|
||||
Reference in New Issue
Block a user