Skip to content

Commit

Permalink
Fixes for new ArduinoJson
Browse files Browse the repository at this point in the history
  • Loading branch information
jackjansen committed Dec 24, 2024
1 parent 1a287c3 commit f1d0aaa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 7 additions & 7 deletions iotsaRT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,18 @@ bool IotsaRTMod::getHandler(const char *path, JsonObject& reply) {

bool IotsaRTMod::putHandler(const char *path, const JsonVariant& request, JsonObject& reply) {
if (!iotsaConfig.inConfigurationMode()) return false;
JsonObject args = request.as<JsonObject>();
JsonObject reqObj = request.as<JsonObject>();
bool anyDone = false;
if (args.containsKey("stimulus")) {
stimulus = str2stim(args["stimulus"].as<char *>());
const char *arg;
if (getFromRequest<const char *>(reqObj, "stimulus", arg)) {
stimulus = str2stim(arg);
anyDone = true;
}
if (args.containsKey("response")) {
stimulus = str2stim(args["response"].as<char *>());
if (getFromRequest<const char *>(reqObj, "response", arg)) {
response = str2resp(arg);
anyDone = true;
}
if (args.containsKey("duration")) {
duration = args["duration"].as<int>();
if (getFromRequest<int>(reqObj, "duration", duration)) {
anyDone = true;
}

Expand Down
6 changes: 4 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
; http://docs.platformio.org/page/projectconf.html
[platformio]
src_dir = .
; env_default = nodemcuv2

default_envs =
nodemcuv2
esp32thing

[common]
framework = arduino
lib_ldf_mode = deep+
Expand Down

0 comments on commit f1d0aaa

Please sign in to comment.