Add count handling to SFPP

This commit is contained in:
Jonathan Bennett
2025-12-25 22:39:08 -06:00
parent c0d108adff
commit a8c2fb3945
4 changed files with 119 additions and 33 deletions

View File

@@ -790,6 +790,7 @@ bool loadConfig(const char *configPath)
if (yamlConfig["StoreAndForward"]) {
portduino_config.sfpp_stratum0 = (yamlConfig["StoreAndForward"]["Stratum0"]).as<bool>(false);
portduino_config.initial_sync = (yamlConfig["StoreAndForward"]["InitialSync"]).as<int>(10);
}
if (yamlConfig["General"]) {

View File

@@ -171,6 +171,7 @@ extern struct portduino_config_struct {
// Store and Forward++
bool sfpp_stratum0 = false;
int initial_sync = 10;
// General
std::string mac_address = "";
@@ -492,9 +493,11 @@ extern struct portduino_config_struct {
}
// StoreAndForward
if (sfpp_stratum0) {
if (sfpp_stratum0 || initial_sync != 10) {
out << YAML::Key << "StoreAndForward" << YAML::Value << YAML::BeginMap;
out << YAML::Key << "Stratum0" << YAML::Value << true;
out << YAML::Key << "Stratum0" << YAML::Value << sfpp_stratum0;
out << YAML::Key << "InitialSync" << YAML::Value << initial_sync;
out << YAML::EndMap; // StoreAndForward
}