mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2025-12-06 07:42:00 +01:00
Merge branch 'master' into remove_board_finder
This commit is contained in:
commit
84e6197f52
5
.github/workflows/dependabot.yml
vendored
5
.github/workflows/dependabot.yml
vendored
|
|
@ -12,8 +12,9 @@
|
||||||
# name: run PlatformIO Dependabot
|
# name: run PlatformIO Dependabot
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Checkout
|
# - name: Checkout
|
||||||
# uses: actions/checkout@v3
|
# uses: actions/checkout@v4
|
||||||
# - name: run PlatformIO Dependabot
|
# - name: run PlatformIO Dependabot
|
||||||
# uses: peterus/platformio_dependabot@v1
|
# uses: peterus/platformio_dependabot@v1
|
||||||
# with:
|
# with:
|
||||||
# github_token: ${{ secrets.DEPENDABOT_PAT }}
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# assignee: peterus
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ build_flags =
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
bblanchon/ArduinoJson @ 7.0.4
|
bblanchon/ArduinoJson @ 7.1.0
|
||||||
lewisxhe/XPowersLib @ 0.1.8
|
lewisxhe/XPowersLib @ 0.1.8
|
||||||
peterus/APRS-Decoder-Lib @ 0.0.6
|
peterus/APRS-Decoder-Lib @ 0.0.6
|
||||||
peterus/esp-logger @ 1.0.0
|
peterus/esp-logger @ 1.0.0
|
||||||
|
|
@ -59,8 +59,7 @@ lib_deps =
|
||||||
knolleary/PubSubClient@^2.8
|
knolleary/PubSubClient@^2.8
|
||||||
mikalhart/TinyGPSPlus @ 1.1.0
|
mikalhart/TinyGPSPlus @ 1.1.0
|
||||||
shaggydog/OneButton @ 1.5.0
|
shaggydog/OneButton @ 1.5.0
|
||||||
jgromes/RadioLib @ 6.5.0
|
jgromes/RadioLib @ 6.6.0
|
||||||
|
|
||||||
check_tool = cppcheck
|
check_tool = cppcheck
|
||||||
check_skip_packages = yes
|
check_skip_packages = yes
|
||||||
check_flags =
|
check_flags =
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ void ConfigurationManagement::readConfiguration(logging::Logger &logger, Configu
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "Failed to open file for reading, using default configuration.");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "Failed to open file for reading, using default configuration.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DynamicJsonDocument data(2048);
|
JsonDocument data;
|
||||||
DeserializationError error = deserializeJson(data, file);
|
DeserializationError error = deserializeJson(data, file);
|
||||||
if (error) {
|
if (error) {
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, MODULE_NAME, "Failed to read file, using default configuration.");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, MODULE_NAME, "Failed to read file, using default configuration.");
|
||||||
|
|
@ -44,7 +44,7 @@ void ConfigurationManagement::writeConfiguration(logging::Logger &logger, Config
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "Failed to open file for writing...");
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "Failed to open file for writing...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DynamicJsonDocument data(2048);
|
JsonDocument data;
|
||||||
|
|
||||||
writeProjectConfiguration(conf, data);
|
writeProjectConfiguration(conf, data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ public:
|
||||||
void writeConfiguration(logging::Logger &logger, Configuration &conf);
|
void writeConfiguration(logging::Logger &logger, Configuration &conf);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void readProjectConfiguration(DynamicJsonDocument &data, Configuration &conf) = 0;
|
virtual void readProjectConfiguration(JsonDocument &data, Configuration &conf) = 0;
|
||||||
virtual void writeProjectConfiguration(Configuration &conf, DynamicJsonDocument &data) = 0;
|
virtual void writeProjectConfiguration(Configuration &conf, JsonDocument &data) = 0;
|
||||||
|
|
||||||
const String mFilePath;
|
const String mFilePath;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ bool MQTTTask::loop(System &system) {
|
||||||
if (!_toMQTT.empty()) {
|
if (!_toMQTT.empty()) {
|
||||||
std::shared_ptr<APRSMessage> msg = _toMQTT.getElement();
|
std::shared_ptr<APRSMessage> msg = _toMQTT.getElement();
|
||||||
|
|
||||||
DynamicJsonDocument data(1024);
|
JsonDocument data;
|
||||||
data["source"] = msg->getSource();
|
data["source"] = msg->getSource();
|
||||||
data["destination"] = msg->getDestination();
|
data["destination"] = msg->getDestination();
|
||||||
data["path"] = msg->getPath();
|
data["path"] = msg->getPath();
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "project_configuration.h"
|
#include "project_configuration.h"
|
||||||
|
|
||||||
void ProjectConfigurationManagement::readProjectConfiguration(DynamicJsonDocument &data, Configuration &conf) {
|
void ProjectConfigurationManagement::readProjectConfiguration(JsonDocument &data, Configuration &conf) {
|
||||||
if (data.containsKey("callsign"))
|
if (data.containsKey("callsign"))
|
||||||
conf.callsign = data["callsign"].as<String>();
|
conf.callsign = data["callsign"].as<String>();
|
||||||
|
|
||||||
|
|
@ -119,7 +119,7 @@ void ProjectConfigurationManagement::readProjectConfiguration(DynamicJsonDocumen
|
||||||
conf.board = data["board"].as<String>();
|
conf.board = data["board"].as<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &conf, DynamicJsonDocument &data) {
|
void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &conf, JsonDocument &data) {
|
||||||
data["callsign"] = conf.callsign;
|
data["callsign"] = conf.callsign;
|
||||||
|
|
||||||
if (!conf.network.DHCP) {
|
if (!conf.network.DHCP) {
|
||||||
|
|
@ -134,9 +134,9 @@ void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &co
|
||||||
}
|
}
|
||||||
|
|
||||||
data["wifi"]["active"] = conf.wifi.active;
|
data["wifi"]["active"] = conf.wifi.active;
|
||||||
JsonArray aps = data["wifi"].createNestedArray("AP");
|
JsonArray aps = data["wifi"]["AP"].to<JsonArray>();
|
||||||
for (Configuration::Wifi::AP ap : conf.wifi.APs) {
|
for (Configuration::Wifi::AP ap : conf.wifi.APs) {
|
||||||
JsonObject v = aps.createNestedObject();
|
JsonObject v = aps.add<JsonObject>();
|
||||||
v["SSID"] = ap.SSID;
|
v["SSID"] = ap.SSID;
|
||||||
v["password"] = ap.password;
|
v["password"] = ap.password;
|
||||||
}
|
}
|
||||||
|
|
@ -165,9 +165,9 @@ void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &co
|
||||||
data["display"]["overwrite_pin"] = conf.display.overwritePin;
|
data["display"]["overwrite_pin"] = conf.display.overwritePin;
|
||||||
data["display"]["turn180"] = conf.display.turn180;
|
data["display"]["turn180"] = conf.display.turn180;
|
||||||
data["ftp"]["active"] = conf.ftp.active;
|
data["ftp"]["active"] = conf.ftp.active;
|
||||||
JsonArray users = data["ftp"].createNestedArray("user");
|
JsonArray users = data["ftp"]["user"].to<JsonArray>();
|
||||||
for (Configuration::Ftp::User u : conf.ftp.users) {
|
for (Configuration::Ftp::User u : conf.ftp.users) {
|
||||||
JsonObject v = users.createNestedObject();
|
JsonObject v = users.add<JsonObject>();
|
||||||
v["name"] = u.name;
|
v["name"] = u.name;
|
||||||
v["password"] = u.password;
|
v["password"] = u.password;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -175,8 +175,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void readProjectConfiguration(DynamicJsonDocument &data, Configuration &conf) override;
|
virtual void readProjectConfiguration(JsonDocument &data, Configuration &conf) override;
|
||||||
virtual void writeProjectConfiguration(Configuration &conf, DynamicJsonDocument &data) override;
|
virtual void writeProjectConfiguration(Configuration &conf, JsonDocument &data) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue