+ {filter_events.map((e) => (
+
{e.t}
- {paddedLevelLabel(e.l)}
- {paddedNameLabel(e.n)}
+ {compact && {paddedLevelLabel(e.l, compact)} }
+ {!compact && (
+
+ {paddedLevelLabel(e.l, compact)}{' '}
+
+ )}
+ {paddedIDLabel(e.i, compact)}
+ {paddedNameLabel(e.n, compact)}
{e.m}
))}
diff --git a/interface/src/system/LogEventController.tsx b/interface/src/system/LogEventController.tsx
index cdeffafb1..fff3f9478 100644
--- a/interface/src/system/LogEventController.tsx
+++ b/interface/src/system/LogEventController.tsx
@@ -3,22 +3,38 @@ import { Component } from 'react';
import {
restController,
RestControllerProps,
- RestFormLoader,
- SectionContent
+ SectionContent,
+ BlockFormControlLabel
} from '../components';
-import { addAccessTokenParameter } from '../authentication';
+import {
+ ValidatorForm,
+ SelectValidator
+} from 'react-material-ui-form-validator';
+
+import {
+ Grid,
+ Slider,
+ FormLabel,
+ Checkbox,
+ MenuItem,
+ Button
+} from '@material-ui/core';
+
+import {
+ addAccessTokenParameter,
+ redirectingAuthorizedFetch
+} from '../authentication';
+
+import DownloadIcon from '@material-ui/icons/GetApp';
import { ENDPOINT_ROOT, EVENT_SOURCE_ROOT } from '../api';
export const FETCH_LOG_ENDPOINT = ENDPOINT_ROOT + 'fetchLog';
export const LOG_SETTINGS_ENDPOINT = ENDPOINT_ROOT + 'logSettings';
-
export const LOG_EVENT_EVENT_SOURCE_URL = EVENT_SOURCE_ROOT + 'log';
-import LogEventForm from './LogEventForm';
import LogEventConsole from './LogEventConsole';
-
-import { LogEvent, LogSettings } from './types';
+import { LogEvent, LogSettings, LogLevel } from './types';
import { Decoder } from '@msgpack/msgpack';
const decoder = new Decoder();
@@ -26,6 +42,9 @@ const decoder = new Decoder();
interface LogEventControllerState {
eventSource?: EventSource;
events: LogEvent[];
+ compact: boolean;
+ level: number;
+ max_messages: number;
}
type LogEventControllerProps = RestControllerProps
;
@@ -40,12 +59,15 @@ class LogEventController extends Component<
constructor(props: LogEventControllerProps) {
super(props);
this.state = {
- events: []
+ events: [],
+ compact: false,
+ level: 6,
+ max_messages: 25
};
}
componentDidMount() {
- this.props.loadData();
+ this.fetchValues();
this.fetchLog();
this.configureEventSource();
}
@@ -59,6 +81,15 @@ class LogEventController extends Component<
}
}
+ changeCompact = (
+ event: React.ChangeEvent,
+ checked: boolean
+ ) => {
+ this.setState({
+ compact: checked
+ });
+ };
+
fetchLog = () => {
fetch(FETCH_LOG_ENDPOINT)
.then((response) => {
@@ -78,6 +109,25 @@ class LogEventController extends Component<
});
};
+ fetchValues = () => {
+ redirectingAuthorizedFetch(LOG_SETTINGS_ENDPOINT)
+ .then((response) => {
+ if (response.status === 200) {
+ return response.json();
+ }
+ throw Error('Unexpected status code: ' + response.status);
+ })
+ .then((json) => {
+ this.setState({ level: json.level, max_messages: json.max_messages });
+ })
+ .catch((error) => {
+ const errorMessage = error.message || 'Unknown error';
+ this.props.enqueueSnackbar('Problem fetching: ' + errorMessage, {
+ variant: 'error'
+ });
+ });
+ };
+
configureEventSource = () => {
this.eventSource = new EventSource(
addAccessTokenParameter(LOG_EVENT_EVENT_SOURCE_URL)
@@ -102,14 +152,172 @@ class LogEventController extends Component<
}
};
+ changeMaxMessages = (
+ event: React.ChangeEvent<{}>,
+ value: number | number[]
+ ) => {
+ this.setState({
+ max_messages: value as number
+ });
+ this.send_data(this.state.level, value as number);
+ };
+
+ changeLevel = (event: React.ChangeEvent) => {
+ this.setState({
+ level: parseInt(event.target.value)
+ });
+ this.send_data(parseInt(event.target.value), this.state.max_messages);
+ };
+
+ send_data = (level: number, max_messages: number) => {
+ redirectingAuthorizedFetch(LOG_SETTINGS_ENDPOINT, {
+ method: 'POST',
+ body: JSON.stringify({
+ level: level,
+ max_messages: max_messages
+ }),
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ })
+ .then((response) => {
+ if (response.status !== 200) {
+ throw Error('Unexpected response code: ' + response.status);
+ }
+ })
+ .catch((error) => {
+ this.props.enqueueSnackbar(
+ error.message || 'Problem applying log settings',
+ { variant: 'warning' }
+ );
+ });
+ };
+
+ levelLabel = (level: LogLevel) => {
+ switch (level) {
+ case LogLevel.ERROR:
+ return 'E';
+ case LogLevel.WARNING:
+ return 'W';
+ case LogLevel.NOTICE:
+ return 'N';
+ case LogLevel.INFO:
+ return 'I';
+ case LogLevel.DEBUG:
+ return 'D';
+ case LogLevel.TRACE:
+ return 'TRACE';
+ default:
+ return '';
+ }
+ };
+
+ onDownload = () => {
+ const { events, level } = this.state;
+ let result = '';
+ for (const i in events) {
+ if (events[i].l <= level) {
+ result +=
+ events[i].t +
+ ' ' +
+ this.levelLabel(events[i].l) +
+ ' ' +
+ events[i].i +
+ ': [' +
+ events[i].n +
+ '] ' +
+ events[i].m +
+ '\n';
+ }
+ }
+ const a = document.createElement('a');
+ a.setAttribute(
+ 'href',
+ 'data:text/plain;charset=utf-8,' + encodeURIComponent(result)
+ );
+ a.setAttribute('download', 'log.txt');
+ document.body.appendChild(a);
+ a.click();
+ document.body.removeChild(a);
+ };
+
render() {
+ const { saveData } = this.props;
return (
- }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Buffer size
+
+
+
+
+ }
+ label="Compact Layout"
+ />
+
+
+ }
+ variant="contained"
+ color="primary"
+ onClick={this.onDownload}
+ >
+ Download
+
+
+
+
+
+
-
);
}
diff --git a/interface/src/system/LogEventForm.tsx b/interface/src/system/LogEventForm.tsx
deleted file mode 100644
index 16de6ba0e..000000000
--- a/interface/src/system/LogEventForm.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { Component } from 'react';
-
-import {
- ValidatorForm,
- SelectValidator
-} from 'react-material-ui-form-validator';
-
-import { Typography, Grid } from '@material-ui/core';
-
-import MenuItem from '@material-ui/core/MenuItem';
-
-import {
- redirectingAuthorizedFetch,
- withAuthenticatedContext,
- AuthenticatedContextProps
-} from '../authentication';
-
-import { RestFormProps } from '../components';
-import { LogSettings } from './types';
-
-import { ENDPOINT_ROOT } from '../api';
-export const LOG_SETTINGS_ENDPOINT = ENDPOINT_ROOT + 'logSettings';
-
-type LogEventFormProps = AuthenticatedContextProps & RestFormProps;
-
-class LogEventForm extends Component {
- changeLevel = (event: React.ChangeEvent) => {
- const { data, setData } = this.props;
- setData({
- ...data,
- level: parseInt(event.target.value)
- });
-
- redirectingAuthorizedFetch(LOG_SETTINGS_ENDPOINT, {
- method: 'POST',
- body: JSON.stringify({ level: event.target.value }),
- headers: {
- 'Content-Type': 'application/json'
- }
- })
- .then((response) => {
- if (response.status === 200) {
- return response.json();
- }
- throw Error('Unexpected response code: ' + response.status);
- })
- .then((json) => {
- this.props.enqueueSnackbar('Log settings changed', {
- variant: 'success'
- });
- setData({
- ...data,
- level: json.level
- });
- })
- .catch((error) => {
- this.props.enqueueSnackbar(
- error.message || 'Problem changing log settings',
- { variant: 'warning' }
- );
- });
- };
-
- render() {
- const { data, saveData } = this.props;
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- (the last {data.max_messages} messages are buffered and new log
- events are shown in real time)
-
-
-
-
-
- );
- }
-}
-
-export default withAuthenticatedContext(LogEventForm);
diff --git a/interface/src/system/types.ts b/interface/src/system/types.ts
index c7e522440..fdc51626c 100644
--- a/interface/src/system/types.ts
+++ b/interface/src/system/types.ts
@@ -50,6 +50,7 @@ export enum LogLevel {
export interface LogEvent {
t: string;
l: LogLevel;
+ i: number;
n: string;
m: string;
}
diff --git a/interface/src/validators/index.ts b/interface/src/validators/index.ts
index ac394b76a..24224ffd2 100644
--- a/interface/src/validators/index.ts
+++ b/interface/src/validators/index.ts
@@ -3,3 +3,4 @@ export { default as isIP } from './isIP';
export { default as optional } from './optional';
export { default as or } from './or';
export { default as isPath } from './isPath';
+export { default as isIPv4 } from './isIPv4';
diff --git a/interface/src/validators/isIP.ts b/interface/src/validators/isIP.ts
index 295b41398..36ffee158 100644
--- a/interface/src/validators/isIP.ts
+++ b/interface/src/validators/isIP.ts
@@ -1,4 +1,4 @@
-const ipAddressRegexp = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
+const ipAddressRegexp = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/;
export default function isIp(ipAddress: string) {
return ipAddressRegexp.test(ipAddress);
diff --git a/interface/src/validators/isIPv4.ts b/interface/src/validators/isIPv4.ts
new file mode 100644
index 000000000..160bda7c5
--- /dev/null
+++ b/interface/src/validators/isIPv4.ts
@@ -0,0 +1,5 @@
+const ipv4AddressRegexp = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
+
+export default function isIpv4(ipAddress: string) {
+ return ipv4AddressRegexp.test(ipAddress);
+}
diff --git a/lib/ArduinoJson/CHANGELOG.md b/lib/ArduinoJson/CHANGELOG.md
index f3866b3c8..a1bbc5d24 100644
--- a/lib/ArduinoJson/CHANGELOG.md
+++ b/lib/ArduinoJson/CHANGELOG.md
@@ -1,6 +1,31 @@
ArduinoJson: change log
=======================
+v6.18.3 (2021-07-27)
+-------
+
+* Changed return type of `convertToJson()` and `Converter::toJson()` to `void`
+* Added `as()` and `is()`
+
+v6.18.2 (2021-07-19)
+-------
+
+* Removed a symlink because the Arduino Library Specification forbids it
+
+v6.18.1 (2021-07-03)
+-------
+
+* Fixed support for `volatile float` and `volatile double` (issue #1557)
+* Fixed error `[Pe070]: incomplete type is not allowed` on IAR (issue #1560)
+* Fixed `serializeJson(doc, String)` when allocation fails (issue #1572)
+* Fixed clang-tidy warnings (issue #1574, PR #1577 by @armandas)
+* Added fake class `InvalidConversion` to easily identify invalid conversions (issue #1585)
+* Added support for `std::string_view` (issue #1578, PR #1554 by @0xFEEDC0DE64)
+* Fixed warning `definition of implicit copy constructor for 'MsgPackDeserializer' is deprecated because it has a user-declared copy assignment operator`
+* Added `JsonArray::clear()` (issue #1597)
+* Fixed `JsonVariant::as()` (issue #1601)
+* Added support for ESP-IDF component build (PR #1562 by @qt1, PR #1599 by @andreaskuster)
+
v6.18.0 (2021-05-05)
-------
diff --git a/lib/ArduinoJson/README.md b/lib/ArduinoJson/README.md
index c30028435..a9dfbc7f5 100644
--- a/lib/ArduinoJson/README.md
+++ b/lib/ArduinoJson/README.md
@@ -2,7 +2,7 @@
---
-[](https://www.ardu-badge.com/ArduinoJson/6.18.0)
+[](https://www.ardu-badge.com/ArduinoJson/6.18.3)
[](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A6.x)
[](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
@@ -33,15 +33,15 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* [Optionally works without heap memory (zero malloc)](https://arduinojson.org/v6/api/staticjsondocument/?utm_source=github&utm_medium=readme)
* Deduplicates strings
* Versatile
- * [Supports custom allocators (to use external RAM chip, for example)](https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/?utm_source=github&utm_medium=readme)
- * Supports [Arduino's `String`](https://arduinojson.org/v6/api/config/enable_arduino_string/?utm_source=github&utm_medium=readme) and [STL's `std::string`](https://arduinojson.org/v6/api/config/enable_std_string/?utm_source=github&utm_medium=readme)
- * Supports [Arduino's `Stream`](https://arduinojson.org/v6/api/config/enable_arduino_stream/?utm_source=github&utm_medium=readme) and [STL's `std::istream`/`std::ostream`](https://arduinojson.org/v6/api/config/enable_std_stream/?utm_source=github&utm_medium=readme)
- * [Supports Flash strings](https://arduinojson.org/v6/api/config/enable_progmem/?utm_source=github&utm_medium=readme)
+ * Supports [custom allocators (to use external RAM chip, for example)](https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/?utm_source=github&utm_medium=readme)
+ * Supports [`String`](https://arduinojson.org/v6/api/config/enable_arduino_string/?utm_source=github&utm_medium=readme), [`std::string`](https://arduinojson.org/v6/api/config/enable_std_string/?utm_source=github&utm_medium=readme) and [`std::string_view`](https://arduinojson.org/v6/api/config/enable_string_view/?utm_source=github&utm_medium=readme)
+ * Supports [`Stream`](https://arduinojson.org/v6/api/config/enable_arduino_stream/?utm_source=github&utm_medium=readme) and [`std::istream`/`std::ostream`](https://arduinojson.org/v6/api/config/enable_std_stream/?utm_source=github&utm_medium=readme)
+ * Supports [Flash strings](https://arduinojson.org/v6/api/config/enable_progmem/?utm_source=github&utm_medium=readme)
* Supports [custom readers](https://arduinojson.org/v6/api/json/deserializejson/?utm_source=github&utm_medium=readme#custom-reader) and [custom writers](https://arduinojson.org/v6/api/json/serializejson/?utm_source=github&utm_medium=readme#custom-writer)
- * Supports custom converters
+ * Supports [custom converters](https://arduinojson.org/news/2021/05/04/version-6-18-0/?utm_source=github&utm_medium=readme)
* Portable
* Usable on any C++ project (not limited to Arduino)
- * Compatible with C++98
+ * Compatible with C++98, C++11, C++14 and C++17
* Zero warnings with `-Wall -Wextra -pedantic` and `/W4`
* [Header-only library](https://en.wikipedia.org/wiki/Header-only)
* Works with virtually any board
@@ -81,15 +81,17 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).
* [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22)
* [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22)
* [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
+ * Passes all default checks of [clang-tidy](https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/)
* Well documented
* [Tutorials](https://arduinojson.org/v6/doc/deserialization/?utm_source=github&utm_medium=readme)
* [Examples](https://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme)
* [How-tos](https://arduinojson.org/v6/example/?utm_source=github&utm_medium=readme)
* [FAQ](https://arduinojson.org/v6/faq/?utm_source=github&utm_medium=readme)
+ * [Troubleshooter](https://arduinojson.org/v6/troubleshooter/?utm_source=github&utm_medium=readme)
* [Book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme)
* [Changelog](CHANGELOG.md)
* Vibrant user community
- * Most popular of all Arduino libraries on [GitHub](https://github.com/search?o=desc&q=arduino+library&s=stars&type=Repositories) and [PlatformIO](https://platformio.org/lib/search)
+ * Most popular of all Arduino libraries on [GitHub](https://github.com/search?o=desc&q=arduino+library&s=stars&type=Repositories)
* [Used in hundreds of projects](https://www.hackster.io/search?i=projects&q=arduinojson)
* [Responsive support](https://github.com/bblanchon/ArduinoJson/issues?q=is%3Aissue+is%3Aclosed)
@@ -132,9 +134,11 @@ serializeJson(doc, Serial);
See the [tutorial on arduinojson.org](https://arduinojson.org/doc/encoding/?utm_source=github&utm_medium=readme)
-## Support the project
+## Support the project ❤️
-Do you like this library? Please [star this project on GitHub](https://github.com/bblanchon/ArduinoJson/stargazers)!
+Do you like this library?
+Please [star this project on GitHub](https://github.com/bblanchon/ArduinoJson/stargazers)!
What? You don't like it but you *love* it?
-We don't take donations anymore, but [we sell a book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme), so you can help and learn at the same time.
+You can support the project by [purchasing my book](https://arduinojson.org/book/?utm_source=github&utm_medium=readme).
+Alternatively, you can make a recurring donation via [GitHub Sponsors](https://github.com/sponsors/bblanchon).
diff --git a/lib/ArduinoJson/src/ArduinoJson.hpp b/lib/ArduinoJson/src/ArduinoJson.hpp
index 28d42eef5..d16ca08cd 100644
--- a/lib/ArduinoJson/src/ArduinoJson.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson.hpp
@@ -7,11 +7,11 @@
#include "ArduinoJson/Configuration.hpp"
#if !ARDUINOJSON_DEBUG
-#ifdef __clang__
-#pragma clang system_header
-#elif defined __GNUC__
-#pragma GCC system_header
-#endif
+# ifdef __clang__
+# pragma clang system_header
+# elif defined __GNUC__
+# pragma GCC system_header
+# endif
#endif
#include "ArduinoJson/Array/ArrayRef.hpp"
diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayRef.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayRef.hpp
index a991db0d7..4f8d0c631 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Array/ArrayRef.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Array/ArrayRef.hpp
@@ -161,14 +161,20 @@ class ArrayRef : public ArrayRefBase,
_data->removeElement(index);
}
+ void clear() const {
+ if (!_data)
+ return;
+ _data->clear();
+ }
+
private:
MemoryPool* _pool;
};
template <>
struct Converter {
- static bool toJson(VariantConstRef src, VariantRef dst) {
- return variantCopyFrom(getData(dst), getData(src), getPool(dst));
+ static void toJson(VariantConstRef src, VariantRef dst) {
+ variantCopyFrom(getData(dst), getData(src), getPool(dst));
}
static ArrayConstRef fromJson(VariantConstRef src) {
@@ -183,8 +189,8 @@ struct Converter {
template <>
struct Converter {
- static bool toJson(VariantConstRef src, VariantRef dst) {
- return variantCopyFrom(getData(dst), getData(src), getPool(dst));
+ static void toJson(VariantConstRef src, VariantRef dst) {
+ variantCopyFrom(getData(dst), getData(src), getPool(dst));
}
static ArrayRef fromJson(VariantRef src) {
@@ -193,6 +199,8 @@ struct Converter {
return ArrayRef(pool, data != 0 ? data->asArray() : 0);
}
+ static InvalidConversion fromJson(VariantConstRef);
+
static bool checkJson(VariantConstRef) {
return false;
}
diff --git a/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp b/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp
index c6062e492..c1016eb01 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp
@@ -10,8 +10,8 @@
#include
#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4522)
+# pragma warning(push)
+# pragma warning(disable : 4522)
#endif
namespace ARDUINOJSON_NAMESPACE {
@@ -178,8 +178,8 @@ class ElementProxy : public VariantOperators >,
return _array.getOrAddElement(_index);
}
- friend bool convertToJson(const this_type& src, VariantRef dst) {
- return dst.set(src.getUpstreamElement());
+ friend void convertToJson(const this_type& src, VariantRef dst) {
+ dst.set(src.getUpstreamElement());
}
TArray _array;
@@ -189,5 +189,5 @@ class ElementProxy : public VariantOperators >,
} // namespace ARDUINOJSON_NAMESPACE
#ifdef _MSC_VER
-#pragma warning(pop)
+# pragma warning(pop)
#endif
diff --git a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp
index 49a24beed..f814bcdf2 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp
@@ -62,9 +62,9 @@ inline bool CollectionData::copyFrom(const CollectionData& src,
VariantData* var;
if (s->key() != 0) {
if (s->ownsKey())
- var = addMember(RamStringAdapter(s->key()), pool);
+ var = addMember(adaptString(const_cast(s->key())), pool);
else
- var = addMember(ConstRamStringAdapter(s->key()), pool);
+ var = addMember(adaptString(s->key()), pool);
} else {
var = addElement(pool);
}
@@ -107,7 +107,7 @@ template
inline VariantSlot* CollectionData::getSlot(TAdaptedString key) const {
VariantSlot* slot = _head;
while (slot) {
- if (key.equals(slot->key()))
+ if (key.compare(slot->key()) == 0)
break;
slot = slot->next();
}
diff --git a/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp b/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp
index 0c0d4c489..332abb6a7 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Configuration.hpp
@@ -5,251 +5,269 @@
#pragma once
#if __cplusplus >= 201103L
-#define ARDUINOJSON_HAS_LONG_LONG 1
-#define ARDUINOJSON_HAS_NULLPTR 1
-#define ARDUINOJSON_HAS_RVALUE_REFERENCES 1
+# define ARDUINOJSON_HAS_LONG_LONG 1
+# define ARDUINOJSON_HAS_RVALUE_REFERENCES 1
#else
-#define ARDUINOJSON_HAS_LONG_LONG 0
-#define ARDUINOJSON_HAS_NULLPTR 0
-#define ARDUINOJSON_HAS_RVALUE_REFERENCES 0
+# define ARDUINOJSON_HAS_LONG_LONG 0
+# define ARDUINOJSON_HAS_RVALUE_REFERENCES 0
+#endif
+
+#ifndef ARDUINOJSON_HAS_NULLPTR
+# if __cplusplus >= 201103L
+# define ARDUINOJSON_HAS_NULLPTR 1
+# else
+# define ARDUINOJSON_HAS_NULLPTR 0
+# endif
#endif
#if defined(_MSC_VER) && !ARDUINOJSON_HAS_LONG_LONG
-#define ARDUINOJSON_HAS_INT64 1
+# define ARDUINOJSON_HAS_INT64 1
#else
-#define ARDUINOJSON_HAS_INT64 0
+# define ARDUINOJSON_HAS_INT64 0
#endif
// Small or big machine?
#ifndef ARDUINOJSON_EMBEDDED_MODE
-#if defined(ARDUINO) /* Arduino*/ \
- || defined(__IAR_SYSTEMS_ICC__) /* IAR Embedded Workbench */ \
- || defined(__XC) /* MPLAB XC compiler */ \
- || defined(__ARMCC_VERSION) /* Keil ARM Compiler */ \
- || defined(__AVR) /* Atmel AVR8/GNU C Compiler */
-#define ARDUINOJSON_EMBEDDED_MODE 1
-#else
-#define ARDUINOJSON_EMBEDDED_MODE 0
-#endif
+# if defined(ARDUINO) /* Arduino*/ \
+ || defined(__IAR_SYSTEMS_ICC__) /* IAR Embedded Workbench */ \
+ || defined(__XC) /* MPLAB XC compiler */ \
+ || defined(__ARMCC_VERSION) /* Keil ARM Compiler */ \
+ || defined(__AVR) /* Atmel AVR8/GNU C Compiler */
+# define ARDUINOJSON_EMBEDDED_MODE 1
+# else
+# define ARDUINOJSON_EMBEDDED_MODE 0
+# endif
#endif
// Auto enable std::stream if the right headers are here and no conflicting
// macro is defined
#if !defined(ARDUINOJSON_ENABLE_STD_STREAM) && defined(__has_include)
-#if __has_include() && \
+# if __has_include() && \
__has_include() && \
!defined(min) && \
!defined(max)
-#define ARDUINOJSON_ENABLE_STD_STREAM 1
-#else
-#define ARDUINOJSON_ENABLE_STD_STREAM 0
-#endif
+# define ARDUINOJSON_ENABLE_STD_STREAM 1
+# else
+# define ARDUINOJSON_ENABLE_STD_STREAM 0
+# endif
#endif
// Auto enable std::string if the right header is here and no conflicting
// macro is defined
#if !defined(ARDUINOJSON_ENABLE_STD_STRING) && defined(__has_include)
-#if __has_include() && !defined(min) && !defined(max)
-#define ARDUINOJSON_ENABLE_STD_STRING 1
-#else
-#define ARDUINOJSON_ENABLE_STD_STRING 0
+# if __has_include() && !defined(min) && !defined(max)
+# define ARDUINOJSON_ENABLE_STD_STRING 1
+# else
+# define ARDUINOJSON_ENABLE_STD_STRING 0
+# endif
#endif
+
+#ifndef ARDUINOJSON_ENABLE_STRING_VIEW
+# ifdef __has_include
+# if __has_include() && __cplusplus >= 201703L
+# define ARDUINOJSON_ENABLE_STRING_VIEW 1
+# endif
+# endif
+#endif
+#ifndef ARDUINOJSON_ENABLE_STRING_VIEW
+# define ARDUINOJSON_ENABLE_STRING_VIEW 0
#endif
#if ARDUINOJSON_EMBEDDED_MODE
// Store floats by default to reduce the memory usage (issue #134)
-#ifndef ARDUINOJSON_USE_DOUBLE
-#define ARDUINOJSON_USE_DOUBLE 0
-#endif
+# ifndef ARDUINOJSON_USE_DOUBLE
+# define ARDUINOJSON_USE_DOUBLE 0
+# endif
// Store longs by default, because they usually match the size of a float.
-#ifndef ARDUINOJSON_USE_LONG_LONG
-#define ARDUINOJSON_USE_LONG_LONG 0
-#endif
+# ifndef ARDUINOJSON_USE_LONG_LONG
+# define ARDUINOJSON_USE_LONG_LONG 0
+# endif
// Embedded systems usually don't have std::string
-#ifndef ARDUINOJSON_ENABLE_STD_STRING
-#define ARDUINOJSON_ENABLE_STD_STRING 0
-#endif
+# ifndef ARDUINOJSON_ENABLE_STD_STRING
+# define ARDUINOJSON_ENABLE_STD_STRING 0
+# endif
// Embedded systems usually don't have std::stream
-#ifndef ARDUINOJSON_ENABLE_STD_STREAM
-#define ARDUINOJSON_ENABLE_STD_STREAM 0
-#endif
+# ifndef ARDUINOJSON_ENABLE_STD_STREAM
+# define ARDUINOJSON_ENABLE_STD_STREAM 0
+# endif
// Limit nesting as the stack is likely to be small
-#ifndef ARDUINOJSON_DEFAULT_NESTING_LIMIT
-#define ARDUINOJSON_DEFAULT_NESTING_LIMIT 10
-#endif
+# ifndef ARDUINOJSON_DEFAULT_NESTING_LIMIT
+# define ARDUINOJSON_DEFAULT_NESTING_LIMIT 10
+# endif
// Number of bits to store the pointer to next node
// (saves RAM but limits the number of values in a document)
-#ifndef ARDUINOJSON_SLOT_OFFSET_SIZE
-#if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 2
+# ifndef ARDUINOJSON_SLOT_OFFSET_SIZE
+# if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 2
// Address space == 16-bit => max 127 values
-#define ARDUINOJSON_SLOT_OFFSET_SIZE 1
-#else
+# define ARDUINOJSON_SLOT_OFFSET_SIZE 1
+# else
// Address space > 16-bit => max 32767 values
-#define ARDUINOJSON_SLOT_OFFSET_SIZE 2
-#endif
-#endif
+# define ARDUINOJSON_SLOT_OFFSET_SIZE 2
+# endif
+# endif
#else // ARDUINOJSON_EMBEDDED_MODE
// On a computer we have plenty of memory so we can use doubles
-#ifndef ARDUINOJSON_USE_DOUBLE
-#define ARDUINOJSON_USE_DOUBLE 1
-#endif
+# ifndef ARDUINOJSON_USE_DOUBLE
+# define ARDUINOJSON_USE_DOUBLE 1
+# endif
// Use long long when available
-#ifndef ARDUINOJSON_USE_LONG_LONG
-#if ARDUINOJSON_HAS_LONG_LONG || ARDUINOJSON_HAS_INT64
-#define ARDUINOJSON_USE_LONG_LONG 1
-#else
-#define ARDUINOJSON_USE_LONG_LONG 0
-#endif
-#endif
+# ifndef ARDUINOJSON_USE_LONG_LONG
+# if ARDUINOJSON_HAS_LONG_LONG || ARDUINOJSON_HAS_INT64
+# define ARDUINOJSON_USE_LONG_LONG 1
+# else
+# define ARDUINOJSON_USE_LONG_LONG 0
+# endif
+# endif
// On a computer, we can use std::string
-#ifndef ARDUINOJSON_ENABLE_STD_STRING
-#define ARDUINOJSON_ENABLE_STD_STRING 1
-#endif
+# ifndef ARDUINOJSON_ENABLE_STD_STRING
+# define ARDUINOJSON_ENABLE_STD_STRING 1
+# endif
// On a computer, we can assume std::stream
-#ifndef ARDUINOJSON_ENABLE_STD_STREAM
-#define ARDUINOJSON_ENABLE_STD_STREAM 1
-#endif
+# ifndef ARDUINOJSON_ENABLE_STD_STREAM
+# define ARDUINOJSON_ENABLE_STD_STREAM 1
+# endif
// On a computer, the stack is large so we can increase nesting limit
-#ifndef ARDUINOJSON_DEFAULT_NESTING_LIMIT
-#define ARDUINOJSON_DEFAULT_NESTING_LIMIT 50
-#endif
+# ifndef ARDUINOJSON_DEFAULT_NESTING_LIMIT
+# define ARDUINOJSON_DEFAULT_NESTING_LIMIT 50
+# endif
// Number of bits to store the pointer to next node
-#ifndef ARDUINOJSON_SLOT_OFFSET_SIZE
-#define ARDUINOJSON_SLOT_OFFSET_SIZE 4
-#endif
+# ifndef ARDUINOJSON_SLOT_OFFSET_SIZE
+# define ARDUINOJSON_SLOT_OFFSET_SIZE 4
+# endif
#endif // ARDUINOJSON_EMBEDDED_MODE
#ifdef ARDUINO
-#include
+# include
// Enable support for Arduino's String class
-#ifndef ARDUINOJSON_ENABLE_ARDUINO_STRING
-#define ARDUINOJSON_ENABLE_ARDUINO_STRING 1
-#endif
+# ifndef ARDUINOJSON_ENABLE_ARDUINO_STRING
+# define ARDUINOJSON_ENABLE_ARDUINO_STRING 1
+# endif
// Enable support for Arduino's Stream class
-#ifndef ARDUINOJSON_ENABLE_ARDUINO_STREAM
-#define ARDUINOJSON_ENABLE_ARDUINO_STREAM 1
-#endif
+# ifndef ARDUINOJSON_ENABLE_ARDUINO_STREAM
+# define ARDUINOJSON_ENABLE_ARDUINO_STREAM 1
+# endif
// Enable support for Arduino's Print class
-#ifndef ARDUINOJSON_ENABLE_ARDUINO_PRINT
-#define ARDUINOJSON_ENABLE_ARDUINO_PRINT 1
-#endif
+# ifndef ARDUINOJSON_ENABLE_ARDUINO_PRINT
+# define ARDUINOJSON_ENABLE_ARDUINO_PRINT 1
+# endif
#else // ARDUINO
// Disable support for Arduino's String class
-#ifndef ARDUINOJSON_ENABLE_ARDUINO_STRING
-#define ARDUINOJSON_ENABLE_ARDUINO_STRING 0
-#endif
+# ifndef ARDUINOJSON_ENABLE_ARDUINO_STRING
+# define ARDUINOJSON_ENABLE_ARDUINO_STRING 0
+# endif
// Disable support for Arduino's Stream class
-#ifndef ARDUINOJSON_ENABLE_ARDUINO_STREAM
-#define ARDUINOJSON_ENABLE_ARDUINO_STREAM 0
-#endif
+# ifndef ARDUINOJSON_ENABLE_ARDUINO_STREAM
+# define ARDUINOJSON_ENABLE_ARDUINO_STREAM 0
+# endif
// Disable support for Arduino's Print class
-#ifndef ARDUINOJSON_ENABLE_ARDUINO_PRINT
-#define ARDUINOJSON_ENABLE_ARDUINO_PRINT 0
-#endif
+# ifndef ARDUINOJSON_ENABLE_ARDUINO_PRINT
+# define ARDUINOJSON_ENABLE_ARDUINO_PRINT 0
+# endif
#endif // ARDUINO
#ifndef ARDUINOJSON_ENABLE_PROGMEM
-#if defined(PROGMEM) && defined(pgm_read_byte) && defined(pgm_read_dword) && \
- defined(pgm_read_ptr) && defined(pgm_read_float)
-#define ARDUINOJSON_ENABLE_PROGMEM 1
-#else
-#define ARDUINOJSON_ENABLE_PROGMEM 0
-#endif
+# if defined(PROGMEM) && defined(pgm_read_byte) && defined(pgm_read_dword) && \
+ defined(pgm_read_ptr) && defined(pgm_read_float)
+# define ARDUINOJSON_ENABLE_PROGMEM 1
+# else
+# define ARDUINOJSON_ENABLE_PROGMEM 0
+# endif
#endif
// Convert unicode escape sequence (\u0123) to UTF-8
#ifndef ARDUINOJSON_DECODE_UNICODE
-#define ARDUINOJSON_DECODE_UNICODE 1
+# define ARDUINOJSON_DECODE_UNICODE 1
#endif
// Ignore comments in input
#ifndef ARDUINOJSON_ENABLE_COMMENTS
-#define ARDUINOJSON_ENABLE_COMMENTS 0
+# define ARDUINOJSON_ENABLE_COMMENTS 0
#endif
// Support NaN in JSON
#ifndef ARDUINOJSON_ENABLE_NAN
-#define ARDUINOJSON_ENABLE_NAN 0
+# define ARDUINOJSON_ENABLE_NAN 0
#endif
// Support Infinity in JSON
#ifndef ARDUINOJSON_ENABLE_INFINITY
-#define ARDUINOJSON_ENABLE_INFINITY 0
+# define ARDUINOJSON_ENABLE_INFINITY 0
#endif
// Control the exponentiation threshold for big numbers
// CAUTION: cannot be more that 1e9 !!!!
#ifndef ARDUINOJSON_POSITIVE_EXPONENTIATION_THRESHOLD
-#define ARDUINOJSON_POSITIVE_EXPONENTIATION_THRESHOLD 1e7
+# define ARDUINOJSON_POSITIVE_EXPONENTIATION_THRESHOLD 1e7
#endif
// Control the exponentiation threshold for small numbers
#ifndef ARDUINOJSON_NEGATIVE_EXPONENTIATION_THRESHOLD
-#define ARDUINOJSON_NEGATIVE_EXPONENTIATION_THRESHOLD 1e-5
+# define ARDUINOJSON_NEGATIVE_EXPONENTIATION_THRESHOLD 1e-5
#endif
#ifndef ARDUINOJSON_LITTLE_ENDIAN
-#if defined(_MSC_VER) || \
- (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \
- defined(__LITTLE_ENDIAN__) || defined(__i386) || defined(__x86_64)
-#define ARDUINOJSON_LITTLE_ENDIAN 1
-#else
-#define ARDUINOJSON_LITTLE_ENDIAN 0
-#endif
+# if defined(_MSC_VER) || \
+ (defined(__BYTE_ORDER__) && \
+ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \
+ defined(__LITTLE_ENDIAN__) || defined(__i386) || defined(__x86_64)
+# define ARDUINOJSON_LITTLE_ENDIAN 1
+# else
+# define ARDUINOJSON_LITTLE_ENDIAN 0
+# endif
#endif
#ifndef ARDUINOJSON_ENABLE_ALIGNMENT
-#if defined(__AVR)
-#define ARDUINOJSON_ENABLE_ALIGNMENT 0
-#else
-#define ARDUINOJSON_ENABLE_ALIGNMENT 1
-#endif
+# if defined(__AVR)
+# define ARDUINOJSON_ENABLE_ALIGNMENT 0
+# else
+# define ARDUINOJSON_ENABLE_ALIGNMENT 1
+# endif
#endif
#ifndef ARDUINOJSON_TAB
-#define ARDUINOJSON_TAB " "
+# define ARDUINOJSON_TAB " "
#endif
#ifndef ARDUINOJSON_ENABLE_STRING_DEDUPLICATION
-#define ARDUINOJSON_ENABLE_STRING_DEDUPLICATION 1
+# define ARDUINOJSON_ENABLE_STRING_DEDUPLICATION 1
#endif
#ifndef ARDUINOJSON_STRING_BUFFER_SIZE
-#define ARDUINOJSON_STRING_BUFFER_SIZE 32
+# define ARDUINOJSON_STRING_BUFFER_SIZE 32
#endif
#ifndef ARDUINOJSON_DEBUG
-#ifdef __PLATFORMIO_BUILD_DEBUG__
-#define ARDUINOJSON_DEBUG 1
-#else
-#define ARDUINOJSON_DEBUG 0
-#endif
+# ifdef __PLATFORMIO_BUILD_DEBUG__
+# define ARDUINOJSON_DEBUG 1
+# else
+# define ARDUINOJSON_DEBUG 0
+# endif
#endif
#if ARDUINOJSON_HAS_NULLPTR && defined(nullptr)
-#error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr
+# error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr
// See https://github.com/bblanchon/ArduinoJson/issues/1355
#endif
diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp
index 7b617111a..11ec7df66 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp
@@ -9,7 +9,7 @@
#include
#if ARDUINOJSON_ENABLE_STD_STREAM
-#include
+# include
#endif
namespace ARDUINOJSON_NAMESPACE {
diff --git a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp
index e965c8256..9ae2d5987 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp
@@ -40,17 +40,17 @@ struct BoundedReader {
#include
#if ARDUINOJSON_ENABLE_ARDUINO_STREAM
-#include
+# include
#endif
#if ARDUINOJSON_ENABLE_ARDUINO_STRING
-#include
+# include
#endif
#if ARDUINOJSON_ENABLE_PROGMEM
-#include
+# include
#endif
#if ARDUINOJSON_ENABLE_STD_STREAM
-#include
+# include
#endif
diff --git a/lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp b/lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp
index d67d93496..d81853c3a 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp
@@ -32,7 +32,7 @@ class JsonDocument : public Visitable {
void clear() {
_pool.clear();
- _data.setNull();
+ _data.init();
}
template
@@ -304,15 +304,15 @@ class JsonDocument : public Visitable {
protected:
JsonDocument() : _pool(0, 0) {
- _data.setNull();
+ _data.init();
}
JsonDocument(MemoryPool pool) : _pool(pool) {
- _data.setNull();
+ _data.init();
}
JsonDocument(char* buf, size_t capa) : _pool(buf, capa) {
- _data.setNull();
+ _data.init();
}
~JsonDocument() {}
@@ -337,8 +337,8 @@ class JsonDocument : public Visitable {
JsonDocument& operator=(const JsonDocument&);
};
-inline bool convertToJson(const JsonDocument& src, VariantRef dst) {
- return dst.set(src.as());
+inline void convertToJson(const JsonDocument& src, VariantRef dst) {
+ dst.set(src.as());
}
} // namespace ARDUINOJSON_NAMESPACE
diff --git a/lib/ArduinoJson/src/ArduinoJson/Json/Latch.hpp b/lib/ArduinoJson/src/ArduinoJson/Json/Latch.hpp
index aef1fe368..70866d6b7 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Json/Latch.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Json/Latch.hpp
@@ -45,7 +45,8 @@ class Latch {
}
TReader _reader;
- char _current;
+ char _current; // NOLINT(clang-analyzer-optin.cplusplus.UninitializedObject)
+ // Not initialized in constructor (+10 bytes on AVR)
bool _loaded;
#if ARDUINOJSON_DEBUG
bool _ended;
diff --git a/lib/ArduinoJson/src/ArduinoJson/Json/TextFormatter.hpp b/lib/ArduinoJson/src/ArduinoJson/Json/TextFormatter.hpp
index 18694f14e..7795671ff 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Json/TextFormatter.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Json/TextFormatter.hpp
@@ -155,7 +155,6 @@ class TextFormatter {
protected:
CountingDecorator _writer;
- size_t _length;
private:
TextFormatter &operator=(const TextFormatter &); // cannot be assigned
diff --git a/lib/ArduinoJson/src/ArduinoJson/Json/Utf16.hpp b/lib/ArduinoJson/src/ArduinoJson/Json/Utf16.hpp
index 4e2750f3b..e2b901056 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Json/Utf16.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Json/Utf16.hpp
@@ -12,10 +12,10 @@
// we choose to ignore the problem to reduce the size of the code
// Garbage in => Garbage out
#if defined(__GNUC__)
-#if __GNUC__ >= 7
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#endif
+# if __GNUC__ >= 7
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+# endif
#endif
namespace ARDUINOJSON_NAMESPACE {
@@ -31,7 +31,7 @@ inline bool isLowSurrogate(uint16_t codeunit) {
class Codepoint {
public:
- Codepoint() : _highSurrogate(0) {}
+ Codepoint() : _highSurrogate(0), _codepoint(0) {}
bool append(uint16_t codeunit) {
if (isHighSurrogate(codeunit)) {
@@ -61,7 +61,7 @@ class Codepoint {
} // namespace ARDUINOJSON_NAMESPACE
#if defined(__GNUC__)
-#if __GNUC__ >= 8
-#pragma GCC diagnostic pop
-#endif
+# if __GNUC__ >= 8
+# pragma GCC diagnostic pop
+# endif
#endif
diff --git a/lib/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp b/lib/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp
index 49debf856..04e5b2d28 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp
@@ -7,6 +7,7 @@
#include
#include
#include
+#include
#include
#include // memmove
@@ -37,7 +38,8 @@ class MemoryPool {
}
void* buffer() {
- return _begin;
+ return _begin; // NOLINT(clang-analyzer-unix.Malloc)
+ // movePointers() alters this pointer
}
// Gets the capacity of the memoryPool in bytes
@@ -63,7 +65,7 @@ class MemoryPool {
return 0;
#if ARDUINOJSON_ENABLE_STRING_DEDUPLICATION
- const char* existingCopy = findString(str.begin());
+ const char* existingCopy = findString(str);
if (existingCopy)
return existingCopy;
#endif
@@ -85,7 +87,7 @@ class MemoryPool {
const char* saveStringFromFreeZone(size_t len) {
#if ARDUINOJSON_ENABLE_STRING_DEDUPLICATION
- const char* dup = findString(_left);
+ const char* dup = findString(adaptString(_left));
if (dup)
return dup;
#endif
@@ -162,16 +164,11 @@ class MemoryPool {
}
#if ARDUINOJSON_ENABLE_STRING_DEDUPLICATION
- template
- const char* findString(TIterator str) {
+ template
+ const char* findString(const TAdaptedString& str) {
for (char* next = _begin; next < _left; ++next) {
- char* begin = next;
-
- // try to match
- for (TIterator it = str; *it == *next; ++it) {
- if (*next++ == 0)
- return begin;
- }
+ if (str.compare(next) == 0)
+ return next;
// jump to next terminator
while (*next) ++next;
diff --git a/lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackDeserializer.hpp b/lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackDeserializer.hpp
index 8988173e3..1b153a7ca 100644
--- a/lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackDeserializer.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/MsgPack/MsgPackDeserializer.hpp
@@ -15,468 +15,475 @@ namespace ARDUINOJSON_NAMESPACE {
template
class MsgPackDeserializer {
- public:
- MsgPackDeserializer(MemoryPool & pool, TReader reader, TStringStorage stringStorage)
- : _pool(&pool)
- , _reader(reader)
- , _stringStorage(stringStorage)
- , _error(DeserializationError::Ok)
- , _foundSomething(false) {
- }
+ public:
+ MsgPackDeserializer(MemoryPool &pool, TReader reader,
+ TStringStorage stringStorage)
+ : _pool(&pool),
+ _reader(reader),
+ _stringStorage(stringStorage),
+ _error(DeserializationError::Ok),
+ _foundSomething(false) {}
- template
- DeserializationError parse(VariantData & variant, TFilter filter, NestingLimit nestingLimit) {
- parseVariant(&variant, filter, nestingLimit);
- return _foundSomething ? _error : DeserializationError::EmptyInput;
- }
+ template
+ DeserializationError parse(VariantData &variant, TFilter filter,
+ NestingLimit nestingLimit) {
+ parseVariant(&variant, filter, nestingLimit);
+ return _foundSomething ? _error : DeserializationError::EmptyInput;
+ }
- private:
- // Prevent VS warning "assignment operator could not be generated"
- MsgPackDeserializer & operator=(const MsgPackDeserializer &);
+ private:
+ bool invalidInput() {
+ _error = DeserializationError::InvalidInput;
+ return false;
+ }
- bool invalidInput() {
- _error = DeserializationError::InvalidInput;
- return false;
- }
+ template
+ bool parseVariant(VariantData *variant, TFilter filter,
+ NestingLimit nestingLimit) {
+ uint8_t code = 0;
+ if (!readByte(code))
+ return false;
- template
- bool parseVariant(VariantData * variant, TFilter filter, NestingLimit nestingLimit) {
- uint8_t code = 0;
- if (!readByte(code))
- return false;
+ _foundSomething = true;
- _foundSomething = true;
+ bool allowValue = filter.allowValue();
- bool allowValue = filter.allowValue();
+ switch (code) {
+ case 0xc0:
+ // already null
+ return true;
- switch (code) {
- case 0xc0:
- // already null
- return true;
-
- case 0xc1:
- return invalidInput();
-
- case 0xc2:
- if (allowValue)
- variant->setBoolean(false);
- return true;
-
- case 0xc3:
- if (allowValue)
- variant->setBoolean(true);
- return true;
-
- case 0xc4: // bin 8 (not supported)
- return skipString();
-
- case 0xc5: // bin 16 (not supported)
- return skipString();
-
- case 0xc6: // bin 32 (not supported)
- return skipString();
-
- case 0xc7: // ext 8 (not supported)
- return skipExt();
-
- case 0xc8: // ext 16 (not supported)
- return skipExt();
-
- case 0xc9: // ext 32 (not supported)
- return skipExt();
-
- case 0xca:
- if (allowValue)
- return readFloat(variant);
- else
- return skipBytes(4);
-
- case 0xcb:
- if (allowValue)
- return readDouble(variant);
- else
- return skipBytes(8);
-
- case 0xcc:
- if (allowValue)
- return readInteger(variant);
- else
- return skipBytes(1);
-
- case 0xcd:
- if (allowValue)
- return readInteger(variant);
- else
- return skipBytes(2);
-
- case 0xce:
- if (allowValue)
- return readInteger(variant);
- else
- return skipBytes(4);
-
- case 0xcf:
-#if ARDUINOJSON_USE_LONG_LONG
- if (allowValue)
- return readInteger(variant);
- else
- return skipBytes(8);
-#else
- return skipBytes(8); // not supported
-#endif
-
- case 0xd0:
- if (allowValue)
- return readInteger(variant);
- else
- return skipBytes(1);
-
- case 0xd1:
- if (allowValue)
- return readInteger(variant);
- else
- return skipBytes(2);
-
- case 0xd2:
- if (allowValue)
- return readInteger(variant);
- else
- return skipBytes(4);
-
- case 0xd3:
-#if ARDUINOJSON_USE_LONG_LONG
- if (allowValue)
- return readInteger(variant);
- else
- return skipBytes(8); // not supported
-#else
- return skipBytes(8);
-#endif
-
- case 0xd4: // fixext 1 (not supported)
- return skipBytes(2);
-
- case 0xd5: // fixext 2 (not supported)
- return skipBytes(3);
-
- case 0xd6: // fixext 4 (not supported)
- return skipBytes(5);
-
- case 0xd7: // fixext 8 (not supported)
- return skipBytes(9);
-
- case 0xd8: // fixext 16 (not supported)
- return skipBytes(17);
-
- case 0xd9:
- if (allowValue)
- return readString(variant);
- else
- return skipString();
-
- case 0xda:
- if (allowValue)
- return readString(variant);
- else
- return skipString();
-
- case 0xdb:
- if (allowValue)
- return readString(variant);
- else
- return skipString();
-
- case 0xdc:
- return readArray(variant, filter, nestingLimit);
-
- case 0xdd:
- return readArray(variant, filter, nestingLimit);
-
- case 0xde:
- return readObject(variant, filter, nestingLimit);
-
- case 0xdf:
- return readObject(variant, filter, nestingLimit);
- }
-
- switch (code & 0xf0) {
- case 0x80:
- return readObject(variant, code & 0x0F, filter, nestingLimit);
-
- case 0x90:
- return readArray(variant, code & 0x0F, filter, nestingLimit);
- }
-
- if ((code & 0xe0) == 0xa0) {
- if (allowValue)
- return readString(variant, code & 0x1f);
- else
- return skipBytes(code & 0x1f);
- }
+ case 0xc1:
+ return invalidInput();
+ case 0xc2:
if (allowValue)
- variant->setInteger(static_cast(code));
-
+ variant->setBoolean(false);
return true;
+
+ case 0xc3:
+ if (allowValue)
+ variant->setBoolean(true);
+ return true;
+
+ case 0xc4: // bin 8 (not supported)
+ return skipString();
+
+ case 0xc5: // bin 16 (not supported)
+ return skipString();
+
+ case 0xc6: // bin 32 (not supported)
+ return skipString();
+
+ case 0xc7: // ext 8 (not supported)
+ return skipExt();
+
+ case 0xc8: // ext 16 (not supported)
+ return skipExt();
+
+ case 0xc9: // ext 32 (not supported)
+ return skipExt();
+
+ case 0xca:
+ if (allowValue)
+ return readFloat(variant);
+ else
+ return skipBytes(4);
+
+ case 0xcb:
+ if (allowValue)
+ return readDouble(variant);
+ else
+ return skipBytes(8);
+
+ case 0xcc:
+ if (allowValue)
+ return readInteger(variant);
+ else
+ return skipBytes(1);
+
+ case 0xcd:
+ if (allowValue)
+ return readInteger(variant);
+ else
+ return skipBytes(2);
+
+ case 0xce:
+ if (allowValue)
+ return readInteger(variant);
+ else
+ return skipBytes(4);
+
+ case 0xcf:
+#if ARDUINOJSON_USE_LONG_LONG
+ if (allowValue)
+ return readInteger(variant);
+ else
+ return skipBytes(8);
+#else
+ return skipBytes(8); // not supported
+#endif
+
+ case 0xd0:
+ if (allowValue)
+ return readInteger(variant);
+ else
+ return skipBytes(1);
+
+ case 0xd1:
+ if (allowValue)
+ return readInteger(variant);
+ else
+ return skipBytes(2);
+
+ case 0xd2:
+ if (allowValue)
+ return readInteger(variant);
+ else
+ return skipBytes(4);
+
+ case 0xd3:
+#if ARDUINOJSON_USE_LONG_LONG
+ if (allowValue)
+ return readInteger(variant);
+ else
+ return skipBytes(8); // not supported
+#else
+ return skipBytes(8);
+#endif
+
+ case 0xd4: // fixext 1 (not supported)
+ return skipBytes(2);
+
+ case 0xd5: // fixext 2 (not supported)
+ return skipBytes(3);
+
+ case 0xd6: // fixext 4 (not supported)
+ return skipBytes(5);
+
+ case 0xd7: // fixext 8 (not supported)
+ return skipBytes(9);
+
+ case 0xd8: // fixext 16 (not supported)
+ return skipBytes(17);
+
+ case 0xd9:
+ if (allowValue)
+ return readString(variant);
+ else
+ return skipString();
+
+ case 0xda:
+ if (allowValue)
+ return readString(variant);
+ else
+ return skipString();
+
+ case 0xdb:
+ if (allowValue)
+ return readString(variant);
+ else
+ return skipString();
+
+ case 0xdc:
+ return readArray(variant, filter, nestingLimit);
+
+ case 0xdd:
+ return readArray(variant, filter, nestingLimit);
+
+ case 0xde:
+ return readObject(variant, filter, nestingLimit);
+
+ case 0xdf:
+ return readObject(variant, filter, nestingLimit);
}
- bool readByte(uint8_t & value) {
- int c = _reader.read();
- if (c < 0) {
- _error = DeserializationError::IncompleteInput;
- return false;
- }
- value = static_cast(c);
- return true;
+ switch (code & 0xf0) {
+ case 0x80:
+ return readObject(variant, code & 0x0F, filter, nestingLimit);
+
+ case 0x90:
+ return readArray(variant, code & 0x0F, filter, nestingLimit);
}
- bool readBytes(uint8_t * p, size_t n) {
- if (_reader.readBytes(reinterpret_cast(p), n) == n)
- return true;
+ if ((code & 0xe0) == 0xa0) {
+ if (allowValue)
+ return readString(variant, code & 0x1f);
+ else
+ return skipBytes(code & 0x1f);
+ }
+
+ if (allowValue)
+ variant->setInteger(static_cast(code));
+
+ return true;
+ }
+
+ bool readByte(uint8_t &value) {
+ int c = _reader.read();
+ if (c < 0) {
+ _error = DeserializationError::IncompleteInput;
+ return false;
+ }
+ value = static_cast(c);
+ return true;
+ }
+
+ bool readBytes(uint8_t *p, size_t n) {
+ if (_reader.readBytes(reinterpret_cast(p), n) == n)
+ return true;
+ _error = DeserializationError::IncompleteInput;
+ return false;
+ }
+
+ template
+ bool readBytes(T &value) {
+ return readBytes(reinterpret_cast(&value), sizeof(value));
+ }
+
+ bool skipBytes(size_t n) {
+ for (; n; --n) {
+ if (_reader.read() < 0) {
_error = DeserializationError::IncompleteInput;
return false;
+ }
+ }
+ return true;
+ }
+
+ template
+ bool readInteger(T &value) {
+ if (!readBytes(value))
+ return false;
+ fixEndianess(value);
+ return true;
+ }
+
+ template
+ bool readInteger(VariantData *variant) {
+ T value;
+ if (!readInteger(value))
+ return false;
+ variant->setInteger(value);
+ return true;
+ }
+
+ template
+ typename enable_if::type readFloat(
+ VariantData *variant) {
+ T value;
+ if (!readBytes(value))
+ return false;
+ fixEndianess(value);
+ variant->setFloat(value);
+ return true;
+ }
+
+ template
+ typename enable_if::type readDouble(
+ VariantData *variant) {
+ T value;
+ if (!readBytes(value))
+ return false;
+ fixEndianess(value);
+ variant->setFloat(value);
+ return true;
+ }
+
+ template
+ typename enable_if::type readDouble(
+ VariantData *variant) {
+ uint8_t i[8]; // input is 8 bytes
+ T value; // output is 4 bytes
+ uint8_t *o = reinterpret_cast(&value);
+ if (!readBytes(i, 8))
+ return false;
+ doubleToFloat(i, o);
+ fixEndianess(value);
+ variant->setFloat(value);
+ return true;
+ }
+
+ template
+ bool readString(VariantData *variant) {
+ T size;
+ if (!readInteger(size))
+ return false;
+ return readString(variant, size);
+ }
+
+ template
+ bool readString() {
+ T size;
+ if (!readInteger(size))
+ return false;
+ return readString(size);
+ }
+
+ template
+ bool skipString() {
+ T size;
+ if (!readInteger(size))
+ return false;
+ return skipBytes(size);
+ }
+
+ bool readString(VariantData *variant, size_t n) {
+ if (!readString(n))
+ return false;
+ variant->setStringPointer(_stringStorage.save(),
+ typename TStringStorage::storage_policy());
+ return true;
+ }
+
+ bool readString(size_t n) {
+ _stringStorage.startString();
+ for (; n; --n) {
+ uint8_t c;
+ if (!readBytes(c))
+ return false;
+ _stringStorage.append(static_cast(c));
+ }
+ _stringStorage.append('\0');
+ if (!_stringStorage.isValid()) {
+ _error = DeserializationError::NoMemory;
+ return false;
}
- template
- bool readBytes(T & value) {
- return readBytes(reinterpret_cast(&value), sizeof(value));
+ return true;
+ }
+
+ template
+ bool readArray(VariantData *variant, TFilter filter,
+ NestingLimit nestingLimit) {
+ TSize size;
+ if (!readInteger(size))
+ return false;
+ return readArray(variant, size, filter, nestingLimit);
+ }
+
+ template
+ bool readArray(VariantData *variant, size_t n, TFilter filter,
+ NestingLimit nestingLimit) {
+ if (nestingLimit.reached()) {
+ _error = DeserializationError::TooDeep;
+ return false;
}
- bool skipBytes(size_t n) {
- for (; n; --n) {
- if (_reader.read() < 0) {
- _error = DeserializationError::IncompleteInput;
- return false;
- }
+ bool allowArray = filter.allowArray();
+
+ CollectionData *array = allowArray ? &variant->toArray() : 0;
+
+ TFilter memberFilter = filter[0U];
+
+ for (; n; --n) {
+ VariantData *value;
+
+ if (memberFilter.allow()) {
+ value = array->addElement(_pool);
+ if (!value) {
+ _error = DeserializationError::NoMemory;
+ return false;
}
- return true;
+ } else {
+ value = 0;
+ }
+
+ if (!parseVariant(value, memberFilter, nestingLimit.decrement()))
+ return false;
}
- template
- bool readInteger(T & value) {
- if (!readBytes(value))
- return false;
- fixEndianess(value);
- return true;
+ return true;
+ }
+
+ template
+ bool readObject(VariantData *variant, TFilter filter,
+ NestingLimit nestingLimit) {
+ TSize size;
+ if (!readInteger(size))
+ return false;
+ return readObject(variant, size, filter, nestingLimit);
+ }
+
+ template
+ bool readObject(VariantData *variant, size_t n, TFilter filter,
+ NestingLimit nestingLimit) {
+ if (nestingLimit.reached()) {
+ _error = DeserializationError::TooDeep;
+ return false;
}
- template
- bool readInteger(VariantData * variant) {
- T value;
- if (!readInteger(value))
- return false;
- variant->setInteger(value);
- return true;
- }
+ CollectionData *object = filter.allowObject() ? &variant->toObject() : 0;
- template
- typename enable_if::type readFloat(VariantData * variant) {
- T value;
- if (!readBytes(value))
- return false;
- fixEndianess(value);
- variant->setFloat(value);
- return true;
- }
+ for (; n; --n) {
+ if (!readKey())
+ return false;
- template
- typename enable_if::type readDouble(VariantData * variant) {
- T value;
- if (!readBytes(value))
- return false;
- fixEndianess(value);
- variant->setFloat(value);
- return true;
- }
+ const char *key = _stringStorage.c_str();
+ TFilter memberFilter = filter[key];
+ VariantData *member;
- template
- typename enable_if::type readDouble(VariantData * variant) {
- uint8_t i[8]; // input is 8 bytes
- T value; // output is 4 bytes
- uint8_t * o = reinterpret_cast(&value);
- if (!readBytes(i, 8))
- return false;
- doubleToFloat(i, o);
- fixEndianess(value);
- variant->setFloat(value);
- return true;
- }
+ if (memberFilter.allow()) {
+ // Save key in memory pool.
+ // This MUST be done before adding the slot.
+ key = _stringStorage.save();
- template
- bool readString(VariantData * variant) {
- T size;
- if (!readInteger(size))
- return false;
- return readString(variant, size);
- }
-
- template
- bool readString() {
- T size;
- if (!readInteger(size))
- return false;
- return readString(size);
- }
-
- template
- bool skipString() {
- T size;
- if (!readInteger(size))
- return false;
- return skipBytes(size);
- }
-
- bool readString(VariantData * variant, size_t n) {
- if (!readString(n))
- return false;
- variant->setStringPointer(_stringStorage.save(), typename TStringStorage::storage_policy());
- return true;
- }
-
- bool readString(size_t n) {
- _stringStorage.startString();
- for (; n; --n) {
- uint8_t c;
- if (!readBytes(c))
- return false;
- _stringStorage.append(static_cast(c));
- }
- _stringStorage.append('\0');
- if (!_stringStorage.isValid()) {
- _error = DeserializationError::NoMemory;
- return false;
+ VariantSlot *slot = object->addSlot(_pool);
+ if (!slot) {
+ _error = DeserializationError::NoMemory;
+ return false;
}
- return true;
+ slot->setKey(key, typename TStringStorage::storage_policy());
+
+ member = slot->data();
+ } else {
+ member = 0;
+ }
+
+ if (!parseVariant(member, memberFilter, nestingLimit.decrement()))
+ return false;
}
- template
- bool readArray(VariantData * variant, TFilter filter, NestingLimit nestingLimit) {
- TSize size;
- if (!readInteger(size))
- return false;
- return readArray(variant, size, filter, nestingLimit);
+ return true;
+ }
+
+ bool readKey() {
+ uint8_t code;
+ if (!readByte(code))
+ return false;
+
+ if ((code & 0xe0) == 0xa0)
+ return readString(code & 0x1f);
+
+ switch (code) {
+ case 0xd9:
+ return readString();
+
+ case 0xda:
+ return readString();
+
+ case 0xdb:
+ return readString();
+
+ default:
+ return invalidInput();
}
+ }
- template
- bool readArray(VariantData * variant, size_t n, TFilter filter, NestingLimit nestingLimit) {
- if (nestingLimit.reached()) {
- _error = DeserializationError::TooDeep;
- return false;
- }
+ template
+ bool skipExt() {
+ T size;
+ if (!readInteger(size))
+ return false;
+ return skipBytes(size + 1);
+ }
- bool allowArray = filter.allowArray();
-
- CollectionData * array = allowArray ? &variant->toArray() : 0;
-
- TFilter memberFilter = filter[0U];
-
- for (; n; --n) {
- VariantData * value;
-
- if (memberFilter.allow()) {
- value = array->addElement(_pool);
- if (!value) {
- _error = DeserializationError::NoMemory;
- return false;
- }
- } else {
- value = 0;
- }
-
- if (!parseVariant(value, memberFilter, nestingLimit.decrement()))
- return false;
- }
-
- return true;
- }
-
- template
- bool readObject(VariantData * variant, TFilter filter, NestingLimit nestingLimit) {
- TSize size;
- if (!readInteger(size))
- return false;
- return readObject(variant, size, filter, nestingLimit);
- }
-
- template
- bool readObject(VariantData * variant, size_t n, TFilter filter, NestingLimit nestingLimit) {
- if (nestingLimit.reached()) {
- _error = DeserializationError::TooDeep;
- return false;
- }
-
- CollectionData * object = filter.allowObject() ? &variant->toObject() : 0;
-
- for (; n; --n) {
- if (!readKey())
- return false;
-
- const char * key = _stringStorage.c_str();
- TFilter memberFilter = filter[key];
- VariantData * member;
-
- if (memberFilter.allow()) {
- // Save key in memory pool.
- // This MUST be done before adding the slot.
- key = _stringStorage.save();
-
- VariantSlot * slot = object->addSlot(_pool);
- if (!slot) {
- _error = DeserializationError::NoMemory;
- return false;
- }
-
- slot->setKey(key, typename TStringStorage::storage_policy());
-
- member = slot->data();
- } else {
- member = 0;
- }
-
- if (!parseVariant(member, memberFilter, nestingLimit.decrement()))
- return false;
- }
-
- return true;
- }
-
- bool readKey() {
- uint8_t code;
- if (!readByte(code))
- return false;
-
- if ((code & 0xe0) == 0xa0)
- return readString(code & 0x1f);
-
- switch (code) {
- case 0xd9:
- return readString();
-
- case 0xda:
- return readString();
-
- case 0xdb:
- return readString();
-
- default:
- return invalidInput();
- }
- }
-
- template
- bool skipExt() {
- T size;
- if (!readInteger(size))
- return false;
- return skipBytes(size + 1);
- }
-
- MemoryPool * _pool;
- TReader _reader;
- TStringStorage _stringStorage;
- DeserializationError _error;
- bool _foundSomething;
+ MemoryPool *_pool;
+ TReader _reader;
+ TStringStorage _stringStorage;
+ DeserializationError _error;
+ bool _foundSomething;
};
//
@@ -484,18 +491,25 @@ class MsgPackDeserializer {
//
// ... = NestingLimit
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, const TString & input, NestingLimit nestingLimit = NestingLimit()) {
- return deserialize(doc, input, nestingLimit, AllowAllFilter());
+DeserializationError deserializeMsgPack(
+ JsonDocument &doc, const TString &input,
+ NestingLimit nestingLimit = NestingLimit()) {
+ return deserialize(doc, input, nestingLimit,
+ AllowAllFilter());
}
// ... = Filter, NestingLimit
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, const TString & input, Filter filter, NestingLimit nestingLimit = NestingLimit()) {
- return deserialize(doc, input, nestingLimit, filter);
+DeserializationError deserializeMsgPack(
+ JsonDocument &doc, const TString &input, Filter filter,
+ NestingLimit nestingLimit = NestingLimit()) {
+ return deserialize(doc, input, nestingLimit, filter);
}
// ... = NestingLimit, Filter
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, const TString & input, NestingLimit nestingLimit, Filter filter) {
- return deserialize(doc, input, nestingLimit, filter);
+DeserializationError deserializeMsgPack(JsonDocument &doc, const TString &input,
+ NestingLimit nestingLimit,
+ Filter filter) {
+ return deserialize(doc, input, nestingLimit, filter);
}
//
@@ -503,18 +517,25 @@ DeserializationError deserializeMsgPack(JsonDocument & doc, const TString & inpu
//
// ... = NestingLimit
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TStream & input, NestingLimit nestingLimit = NestingLimit()) {
- return deserialize(doc, input, nestingLimit, AllowAllFilter());
+DeserializationError deserializeMsgPack(
+ JsonDocument &doc, TStream &input,
+ NestingLimit nestingLimit = NestingLimit()) {
+ return deserialize(doc, input, nestingLimit,
+ AllowAllFilter());
}
// ... = Filter, NestingLimit
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TStream & input, Filter filter, NestingLimit nestingLimit = NestingLimit()) {
- return deserialize(doc, input, nestingLimit, filter);
+DeserializationError deserializeMsgPack(
+ JsonDocument &doc, TStream &input, Filter filter,
+ NestingLimit nestingLimit = NestingLimit()) {
+ return deserialize(doc, input, nestingLimit, filter);
}
// ... = NestingLimit, Filter
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TStream & input, NestingLimit nestingLimit, Filter filter) {
- return deserialize(doc, input, nestingLimit, filter);
+DeserializationError deserializeMsgPack(JsonDocument &doc, TStream &input,
+ NestingLimit nestingLimit,
+ Filter filter) {
+ return deserialize(doc, input, nestingLimit, filter);
}
//
@@ -522,18 +543,25 @@ DeserializationError deserializeMsgPack(JsonDocument & doc, TStream & input, Nes
//
// ... = NestingLimit
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, NestingLimit nestingLimit = NestingLimit()) {
- return deserialize(doc, input, nestingLimit, AllowAllFilter());
+DeserializationError deserializeMsgPack(
+ JsonDocument &doc, TChar *input,
+ NestingLimit nestingLimit = NestingLimit()) {
+ return deserialize(doc, input, nestingLimit,
+ AllowAllFilter());
}
// ... = Filter, NestingLimit
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, Filter filter, NestingLimit nestingLimit = NestingLimit()) {
- return deserialize(doc, input, nestingLimit, filter);
+DeserializationError deserializeMsgPack(
+ JsonDocument &doc, TChar *input, Filter filter,
+ NestingLimit nestingLimit = NestingLimit()) {
+ return deserialize(doc, input, nestingLimit, filter);
}
// ... = NestingLimit, Filter
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, NestingLimit nestingLimit, Filter filter) {
- return deserialize(doc, input, nestingLimit, filter);
+DeserializationError deserializeMsgPack(JsonDocument &doc, TChar *input,
+ NestingLimit nestingLimit,
+ Filter filter) {
+ return deserialize(doc, input, nestingLimit, filter);
}
//
@@ -541,18 +569,28 @@ DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, Nesti
//
// ... = NestingLimit
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, size_t inputSize, NestingLimit nestingLimit = NestingLimit()) {
- return deserialize(doc, input, inputSize, nestingLimit, AllowAllFilter());
+DeserializationError deserializeMsgPack(
+ JsonDocument &doc, TChar *input, size_t inputSize,
+ NestingLimit nestingLimit = NestingLimit()) {
+ return deserialize(doc, input, inputSize, nestingLimit,
+ AllowAllFilter());
}
// ... = Filter, NestingLimit
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, size_t inputSize, Filter filter, NestingLimit nestingLimit = NestingLimit()) {
- return deserialize(doc, input, inputSize, nestingLimit, filter);
+DeserializationError deserializeMsgPack(
+ JsonDocument &doc, TChar *input, size_t inputSize, Filter filter,
+ NestingLimit nestingLimit = NestingLimit()) {
+ return deserialize(doc, input, inputSize, nestingLimit,
+ filter);
}
// ... = NestingLimit, Filter
template
-DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, size_t inputSize, NestingLimit nestingLimit, Filter filter) {
- return deserialize(doc, input, inputSize, nestingLimit, filter);
+DeserializationError deserializeMsgPack(JsonDocument &doc, TChar *input,
+ size_t inputSize,
+ NestingLimit nestingLimit,
+ Filter filter) {
+ return deserialize(doc, input, inputSize, nestingLimit,
+ filter);
}
-} // namespace ARDUINOJSON_NAMESPACE
+} // namespace ARDUINOJSON_NAMESPACE
diff --git a/lib/ArduinoJson/src/ArduinoJson/Namespace.hpp b/lib/ArduinoJson/src/ArduinoJson/Namespace.hpp
index 2d85440aa..26def8ab0 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Namespace.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Namespace.hpp
@@ -10,17 +10,17 @@
#ifndef ARDUINOJSON_NAMESPACE
-#define ARDUINOJSON_NAMESPACE \
- ARDUINOJSON_CONCAT4( \
- ARDUINOJSON_CONCAT4(ArduinoJson, ARDUINOJSON_VERSION_MAJOR, \
- ARDUINOJSON_VERSION_MINOR, \
- ARDUINOJSON_VERSION_REVISION), \
- _, \
- ARDUINOJSON_HEX_DIGIT(ARDUINOJSON_ENABLE_PROGMEM, \
- ARDUINOJSON_USE_LONG_LONG, ARDUINOJSON_USE_DOUBLE, \
- ARDUINOJSON_ENABLE_STRING_DEDUPLICATION), \
- ARDUINOJSON_HEX_DIGIT( \
- ARDUINOJSON_ENABLE_NAN, ARDUINOJSON_ENABLE_INFINITY, \
- ARDUINOJSON_ENABLE_COMMENTS, ARDUINOJSON_DECODE_UNICODE))
+# define ARDUINOJSON_NAMESPACE \
+ ARDUINOJSON_CONCAT4( \
+ ARDUINOJSON_CONCAT4(ArduinoJson, ARDUINOJSON_VERSION_MAJOR, \
+ ARDUINOJSON_VERSION_MINOR, \
+ ARDUINOJSON_VERSION_REVISION), \
+ _, \
+ ARDUINOJSON_HEX_DIGIT( \
+ ARDUINOJSON_ENABLE_PROGMEM, ARDUINOJSON_USE_LONG_LONG, \
+ ARDUINOJSON_USE_DOUBLE, ARDUINOJSON_ENABLE_STRING_DEDUPLICATION), \
+ ARDUINOJSON_HEX_DIGIT( \
+ ARDUINOJSON_ENABLE_NAN, ARDUINOJSON_ENABLE_INFINITY, \
+ ARDUINOJSON_ENABLE_COMMENTS, ARDUINOJSON_DECODE_UNICODE))
#endif
diff --git a/lib/ArduinoJson/src/ArduinoJson/Numbers/Integer.hpp b/lib/ArduinoJson/src/ArduinoJson/Numbers/Integer.hpp
index fb656a7d9..e0ed519a1 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Numbers/Integer.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Numbers/Integer.hpp
@@ -22,11 +22,11 @@ typedef unsigned long UInt;
} // namespace ARDUINOJSON_NAMESPACE
#if ARDUINOJSON_HAS_LONG_LONG && !ARDUINOJSON_USE_LONG_LONG
-#define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T) \
- static_assert(sizeof(T) <= sizeof(ARDUINOJSON_NAMESPACE::Integer), \
- "To use 64-bit integers with ArduinoJson, you must set " \
- "ARDUINOJSON_USE_LONG_LONG to 1. See " \
- "https://arduinojson.org/v6/api/config/use_long_long/");
+# define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T) \
+ static_assert(sizeof(T) <= sizeof(ARDUINOJSON_NAMESPACE::Integer), \
+ "To use 64-bit integers with ArduinoJson, you must set " \
+ "ARDUINOJSON_USE_LONG_LONG to 1. See " \
+ "https://arduinojson.org/v6/api/config/use_long_long/");
#else
-#define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T)
+# define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T)
#endif
diff --git a/lib/ArduinoJson/src/ArduinoJson/Numbers/convertNumber.hpp b/lib/ArduinoJson/src/ArduinoJson/Numbers/convertNumber.hpp
index 02bbefa50..3087459f4 100644
--- a/lib/ArduinoJson/src/ArduinoJson/Numbers/convertNumber.hpp
+++ b/lib/ArduinoJson/src/ArduinoJson/Numbers/convertNumber.hpp
@@ -5,13 +5,13 @@
#pragma once
#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wconversion"
#elif defined(__GNUC__)
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
-#pragma GCC diagnostic push
-#endif
-#pragma GCC diagnostic ignored "-Wconversion"
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+# pragma GCC diagnostic push
+# endif
+# pragma GCC diagnostic ignored "-Wconversion"
#endif
#include
@@ -71,9 +71,23 @@ canConvertNumber(TIn) {
}
// int32 -> uint32
+// int32 -> uint64
template
typename enable_if::value && is_signed::value &&
- is_integral