File tree 2 files changed +12
-10
lines changed
libraries/esp8266/examples/ConfigFile
2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 12
12
#include < LittleFS.h>
13
13
14
14
// more and possibly updated information can be found at:
15
- // https://arduinojson.org/v6 /example/config/
15
+ // https://arduinojson.org/v7 /example/config/
16
16
17
17
bool loadConfig () {
18
18
File configFile = LittleFS.open (" /config.json" , " r" );
@@ -21,7 +21,7 @@ bool loadConfig() {
21
21
return false ;
22
22
}
23
23
24
- StaticJsonDocument< 200 > doc;
24
+ JsonDocument doc;
25
25
auto error = deserializeJson (doc, configFile);
26
26
if (error) {
27
27
Serial.println (" Failed to parse config file" );
@@ -42,7 +42,7 @@ bool loadConfig() {
42
42
}
43
43
44
44
bool saveConfig () {
45
- StaticJsonDocument< 200 > doc;
45
+ JsonDocument doc;
46
46
doc[" serverName" ] = " api.example.com" ;
47
47
doc[" accessToken" ] = " 128du9as8du12eoue8da98h123ueh9h98" ;
48
48
Original file line number Diff line number Diff line change @@ -297,14 +297,15 @@ function install_library()
297
297
{
298
298
local lib_path=$1
299
299
local name=$2
300
- local archive=$3
301
- local hash=$4
302
- local url=$5
300
+ local extract=$3
301
+ local archive=$4
302
+ local hash=$5
303
+ local url=$6
303
304
304
305
fetch_and_unpack " $archive " " $hash " " $url "
305
306
mkdir -p " $lib_path "
306
307
rm -rf " $lib_path /$name "
307
- mv " $name " " $lib_path /$name "
308
+ mv " $extract " " $lib_path /$name "
308
309
}
309
310
310
311
function install_libraries()
@@ -317,9 +318,10 @@ function install_libraries()
317
318
318
319
install_library " $lib_path " \
319
320
" ArduinoJson" \
320
- " ArduinoJson-v6.11.5.zip" \
321
- " 8b836c862e69e60c4357a5ed7cbcf1310a3bb1c6bd284fe028faaa3d9d7eed319d10febc8a6a3e06040d1c73aaba5ca487aeffe87ae9388dc4ae1677a64d602c" \
322
- " https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.5/ArduinoJson-v6.11.5.zip"
321
+ " ArduinoJson-7.4.1" \
322
+ " ArduinoJson-v7.4.1.zip" \
323
+ " 1bfbc4aa3e4aa3c8e38f660333b6d5129b0443dbd0fd1eb448d14c7f041ffd2df782951ce622c6da50e2a07dcfcd268727b1f0a000211b9a5a92a806b1645bc0" \
324
+ " https://github.com/bblanchon/ArduinoJson/archive/refs/tags/v7.4.1.zip"
323
325
324
326
popd
325
327
}
You can’t perform that action at this time.
0 commit comments