Skip to content

Commit

Permalink
Merge branch 'master' into remove_board_finder
Browse files Browse the repository at this point in the history
  • Loading branch information
peterus committed Sep 13, 2024
2 parents d5c21de + b19e13b commit 84e6197
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
# name: run PlatformIO Dependabot
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# uses: actions/checkout@v4
# - name: run PlatformIO Dependabot
# uses: peterus/platformio_dependabot@v1
# with:
# github_token: ${{ secrets.DEPENDABOT_PAT }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
# assignee: peterus
5 changes: 2 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ build_flags =
monitor_speed = 115200

lib_deps =
bblanchon/ArduinoJson @ 7.0.4
bblanchon/ArduinoJson @ 7.1.0
lewisxhe/XPowersLib @ 0.1.8
peterus/APRS-Decoder-Lib @ 0.0.6
peterus/esp-logger @ 1.0.0
peterus/ESP-FTP-Server-Lib @ 0.14.1
knolleary/PubSubClient@^2.8
mikalhart/TinyGPSPlus @ 1.1.0
shaggydog/OneButton @ 1.5.0
jgromes/RadioLib @ 6.5.0

jgromes/RadioLib @ 6.6.0
check_tool = cppcheck
check_skip_packages = yes
check_flags =
Expand Down
4 changes: 2 additions & 2 deletions src/ConfigurationManagement/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
return;
}
DynamicJsonDocument data(2048);
JsonDocument data;
DeserializationError error = deserializeJson(data, file);
if (error) {
logger.log(logging::LoggerLevel::LOGGER_LEVEL_WARN, MODULE_NAME, "Failed to read file, using default configuration.");
Expand All @@ -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...");
return;
}
DynamicJsonDocument data(2048);
JsonDocument data;

writeProjectConfiguration(conf, data);

Expand Down
4 changes: 2 additions & 2 deletions src/ConfigurationManagement/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class ConfigurationManagement {
void writeConfiguration(logging::Logger &logger, Configuration &conf);

private:
virtual void readProjectConfiguration(DynamicJsonDocument &data, Configuration &conf) = 0;
virtual void writeProjectConfiguration(Configuration &conf, DynamicJsonDocument &data) = 0;
virtual void readProjectConfiguration(JsonDocument &data, Configuration &conf) = 0;
virtual void writeProjectConfiguration(Configuration &conf, JsonDocument &data) = 0;

const String mFilePath;
};
Expand Down
2 changes: 1 addition & 1 deletion src/TaskMQTT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bool MQTTTask::loop(System &system) {
if (!_toMQTT.empty()) {
std::shared_ptr<APRSMessage> msg = _toMQTT.getElement();

DynamicJsonDocument data(1024);
JsonDocument data;
data["source"] = msg->getSource();
data["destination"] = msg->getDestination();
data["path"] = msg->getPath();
Expand Down
12 changes: 6 additions & 6 deletions src/project_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "project_configuration.h"

void ProjectConfigurationManagement::readProjectConfiguration(DynamicJsonDocument &data, Configuration &conf) {
void ProjectConfigurationManagement::readProjectConfiguration(JsonDocument &data, Configuration &conf) {
if (data.containsKey("callsign"))
conf.callsign = data["callsign"].as<String>();

Expand Down Expand Up @@ -119,7 +119,7 @@ void ProjectConfigurationManagement::readProjectConfiguration(DynamicJsonDocumen
conf.board = data["board"].as<String>();
}

void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &conf, DynamicJsonDocument &data) {
void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &conf, JsonDocument &data) {
data["callsign"] = conf.callsign;

if (!conf.network.DHCP) {
Expand All @@ -134,9 +134,9 @@ void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &co
}

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) {
JsonObject v = aps.createNestedObject();
JsonObject v = aps.add<JsonObject>();
v["SSID"] = ap.SSID;
v["password"] = ap.password;
}
Expand Down Expand Up @@ -165,9 +165,9 @@ void ProjectConfigurationManagement::writeProjectConfiguration(Configuration &co
data["display"]["overwrite_pin"] = conf.display.overwritePin;
data["display"]["turn180"] = conf.display.turn180;
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) {
JsonObject v = users.createNestedObject();
JsonObject v = users.add<JsonObject>();
v["name"] = u.name;
v["password"] = u.password;
}
Expand Down
4 changes: 2 additions & 2 deletions src/project_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ class ProjectConfigurationManagement : public ConfigurationManagement {
}

private:
virtual void readProjectConfiguration(DynamicJsonDocument &data, Configuration &conf) override;
virtual void writeProjectConfiguration(Configuration &conf, DynamicJsonDocument &data) override;
virtual void readProjectConfiguration(JsonDocument &data, Configuration &conf) override;
virtual void writeProjectConfiguration(Configuration &conf, JsonDocument &data) override;
};

#endif

0 comments on commit 84e6197

Please sign in to comment.