@alteriom/painlessmesh 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +213 -0
- package/CONTRIBUTING.md +66 -8
- package/README.md +4 -2
- package/RELEASE_GUIDE.md +11 -1
- package/examples/sendToInternet/README.md +56 -4
- package/examples/sendToInternet/callmebot.h +139 -0
- package/examples/sendToInternet/sendToInternet.ino +166 -53
- package/library.json +1 -1
- package/library.properties +1 -1
- package/package.json +1 -1
- package/src/AlteriomPainlessMesh.h +3 -3
- package/src/arduino/wifi.hpp +179 -86
- package/src/painlessMeshSTA.cpp +38 -4
- package/src/painlessMeshSTA.h +13 -1
- package/src/painlessmesh/buffer.hpp +11 -6
- package/src/painlessmesh/callback.hpp +7 -0
- package/src/painlessmesh/gateway.hpp +649 -27
- package/src/painlessmesh/layout.hpp +16 -0
- package/src/painlessmesh/logger.hpp +14 -1
- package/src/painlessmesh/mesh.hpp +410 -103
- package/src/painlessmesh/router.hpp +17 -7
|
@@ -204,9 +204,14 @@ void routePackage(const layout::Layout<T>& layout,
|
|
|
204
204
|
#if ARDUINOJSON_VERSION_MAJOR == 7
|
|
205
205
|
protocol::Variant variant(pkg);
|
|
206
206
|
if (variant.error) {
|
|
207
|
+
// The error is a DeserializationError object, not an integer: passing it
|
|
208
|
+
// through varargs is undefined behaviour. size_t is unsigned long on the
|
|
209
|
+
// 64-bit desktop build and unsigned int on ESP32/ESP8266, so it is cast
|
|
210
|
+
// to one type and printed with the matching specifier.
|
|
207
211
|
Log(ERROR,
|
|
208
|
-
"routePackage(): parsing failed. err=%
|
|
209
|
-
variant.error
|
|
212
|
+
"routePackage(): parsing failed. err=%s, total_length=%lu, data=%s<--\n",
|
|
213
|
+
variant.error.c_str(), static_cast<unsigned long>(pkg.length()),
|
|
214
|
+
pkg.c_str());
|
|
210
215
|
return;
|
|
211
216
|
}
|
|
212
217
|
|
|
@@ -248,15 +253,20 @@ void routePackage(const layout::Layout<T>& layout,
|
|
|
248
253
|
auto variant = std::make_shared<protocol::Variant>(pkg, capacity);
|
|
249
254
|
|
|
250
255
|
if (variant->error) {
|
|
256
|
+
// Same two defects as the ArduinoJson 7 branch above (CodeQL
|
|
257
|
+
// cpp/wrong-type-format-argument, alerts #6-#9).
|
|
251
258
|
if (variant->error == DeserializationError::NoMemory) {
|
|
252
259
|
Log(ERROR,
|
|
253
|
-
"routePackage(): Message too large. length=%
|
|
254
|
-
"nesting_depth=%
|
|
255
|
-
pkg.length(),
|
|
260
|
+
"routePackage(): Message too large. length=%lu, calculated_capacity=%lu, "
|
|
261
|
+
"nesting_depth=%lu. Consider increasing MAX_MESSAGE_CAPACITY if needed.\n",
|
|
262
|
+
static_cast<unsigned long>(pkg.length()),
|
|
263
|
+
static_cast<unsigned long>(calculatedCapacity),
|
|
264
|
+
static_cast<unsigned long>(nestingDepth));
|
|
256
265
|
} else {
|
|
257
266
|
Log(ERROR,
|
|
258
|
-
"routePackage(): parsing failed. err=%
|
|
259
|
-
variant->error
|
|
267
|
+
"routePackage(): parsing failed. err=%s, length=%lu, data=%s<--\n",
|
|
268
|
+
variant->error.c_str(), static_cast<unsigned long>(pkg.length()),
|
|
269
|
+
pkg.c_str());
|
|
260
270
|
}
|
|
261
271
|
return;
|
|
262
272
|
}
|