mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
update TODOs
This commit is contained in:
@@ -16,16 +16,15 @@ namespace ARDUINOJSON_NAMESPACE {
|
|||||||
template <typename TReader, typename TStringStorage>
|
template <typename TReader, typename TStringStorage>
|
||||||
class MsgPackDeserializer {
|
class MsgPackDeserializer {
|
||||||
public:
|
public:
|
||||||
MsgPackDeserializer(MemoryPool* pool, TReader reader,
|
MsgPackDeserializer(MemoryPool * pool, TReader reader, TStringStorage stringStorage)
|
||||||
TStringStorage stringStorage)
|
: _pool(pool)
|
||||||
: _pool(pool),
|
, _reader(reader)
|
||||||
_reader(reader),
|
, _stringStorage(stringStorage)
|
||||||
_stringStorage(stringStorage),
|
, _foundSomething(false) {
|
||||||
_foundSomething(false) {}
|
}
|
||||||
|
|
||||||
template <typename TFilter>
|
template <typename TFilter>
|
||||||
DeserializationError parse(VariantData& variant, TFilter filter,
|
DeserializationError parse(VariantData & variant, TFilter filter, NestingLimit nestingLimit) {
|
||||||
NestingLimit nestingLimit) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
err = parseVariant(&variant, filter, nestingLimit);
|
err = parseVariant(&variant, filter, nestingLimit);
|
||||||
return _foundSomething ? err : DeserializationError::EmptyInput;
|
return _foundSomething ? err : DeserializationError::EmptyInput;
|
||||||
@@ -33,11 +32,10 @@ class MsgPackDeserializer {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename TFilter>
|
template <typename TFilter>
|
||||||
DeserializationError::Code parseVariant(VariantData* variant, TFilter filter,
|
DeserializationError::Code parseVariant(VariantData * variant, TFilter filter, NestingLimit nestingLimit) {
|
||||||
NestingLimit nestingLimit) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
|
|
||||||
uint8_t code = 0; // TODO: why do we need to initialize this variable?
|
uint8_t code = 0;
|
||||||
err = readByte(code);
|
err = readByte(code);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
@@ -222,7 +220,7 @@ class MsgPackDeserializer {
|
|||||||
return DeserializationError::Ok;
|
return DeserializationError::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeserializationError::Code readByte(uint8_t& value) {
|
DeserializationError::Code readByte(uint8_t & value) {
|
||||||
int c = _reader.read();
|
int c = _reader.read();
|
||||||
if (c < 0)
|
if (c < 0)
|
||||||
return DeserializationError::IncompleteInput;
|
return DeserializationError::IncompleteInput;
|
||||||
@@ -230,15 +228,15 @@ class MsgPackDeserializer {
|
|||||||
return DeserializationError::Ok;
|
return DeserializationError::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeserializationError::Code readBytes(uint8_t* p, size_t n) {
|
DeserializationError::Code readBytes(uint8_t * p, size_t n) {
|
||||||
if (_reader.readBytes(reinterpret_cast<char*>(p), n) == n)
|
if (_reader.readBytes(reinterpret_cast<char *>(p), n) == n)
|
||||||
return DeserializationError::Ok;
|
return DeserializationError::Ok;
|
||||||
return DeserializationError::IncompleteInput;
|
return DeserializationError::IncompleteInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
DeserializationError::Code readBytes(T& value) {
|
DeserializationError::Code readBytes(T & value) {
|
||||||
return readBytes(reinterpret_cast<uint8_t*>(&value), sizeof(value));
|
return readBytes(reinterpret_cast<uint8_t *>(&value), sizeof(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
DeserializationError::Code skipBytes(size_t n) {
|
DeserializationError::Code skipBytes(size_t n) {
|
||||||
@@ -250,7 +248,7 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
DeserializationError::Code readInteger(T& value) {
|
DeserializationError::Code readInteger(T & value) {
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
|
|
||||||
err = readBytes(value);
|
err = readBytes(value);
|
||||||
@@ -263,7 +261,7 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
DeserializationError::Code readInteger(VariantData* variant) {
|
DeserializationError::Code readInteger(VariantData * variant) {
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
T value;
|
T value;
|
||||||
|
|
||||||
@@ -277,8 +275,7 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename enable_if<sizeof(T) == 4, DeserializationError::Code>::type
|
typename enable_if<sizeof(T) == 4, DeserializationError::Code>::type readFloat(VariantData * variant) {
|
||||||
readFloat(VariantData* variant) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
T value;
|
T value;
|
||||||
|
|
||||||
@@ -293,8 +290,7 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename enable_if<sizeof(T) == 8, DeserializationError::Code>::type
|
typename enable_if<sizeof(T) == 8, DeserializationError::Code>::type readDouble(VariantData * variant) {
|
||||||
readDouble(VariantData* variant) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
T value;
|
T value;
|
||||||
|
|
||||||
@@ -309,12 +305,11 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename enable_if<sizeof(T) == 4, DeserializationError::Code>::type
|
typename enable_if<sizeof(T) == 4, DeserializationError::Code>::type readDouble(VariantData * variant) {
|
||||||
readDouble(VariantData* variant) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
uint8_t i[8]; // input is 8 bytes
|
uint8_t i[8]; // input is 8 bytes
|
||||||
T value; // output is 4 bytes
|
T value; // output is 4 bytes
|
||||||
uint8_t* o = reinterpret_cast<uint8_t*>(&value);
|
uint8_t * o = reinterpret_cast<uint8_t *>(&value);
|
||||||
|
|
||||||
err = readBytes(i, 8);
|
err = readBytes(i, 8);
|
||||||
if (err)
|
if (err)
|
||||||
@@ -328,7 +323,7 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
DeserializationError::Code readString(VariantData* variant) {
|
DeserializationError::Code readString(VariantData * variant) {
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
T size;
|
T size;
|
||||||
|
|
||||||
@@ -363,7 +358,7 @@ class MsgPackDeserializer {
|
|||||||
return skipBytes(size);
|
return skipBytes(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
DeserializationError::Code readString(VariantData* variant, size_t n) {
|
DeserializationError::Code readString(VariantData * variant, size_t n) {
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
|
|
||||||
err = readString(n);
|
err = readString(n);
|
||||||
@@ -395,8 +390,7 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename TSize, typename TFilter>
|
template <typename TSize, typename TFilter>
|
||||||
DeserializationError::Code readArray(VariantData* variant, TFilter filter,
|
DeserializationError::Code readArray(VariantData * variant, TFilter filter, NestingLimit nestingLimit) {
|
||||||
NestingLimit nestingLimit) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
TSize size;
|
TSize size;
|
||||||
|
|
||||||
@@ -408,9 +402,7 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename TFilter>
|
template <typename TFilter>
|
||||||
DeserializationError::Code readArray(VariantData* variant, size_t n,
|
DeserializationError::Code readArray(VariantData * variant, size_t n, TFilter filter, NestingLimit nestingLimit) {
|
||||||
TFilter filter,
|
|
||||||
NestingLimit nestingLimit) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
|
|
||||||
if (nestingLimit.reached())
|
if (nestingLimit.reached())
|
||||||
@@ -418,12 +410,12 @@ class MsgPackDeserializer {
|
|||||||
|
|
||||||
bool allowArray = filter.allowArray();
|
bool allowArray = filter.allowArray();
|
||||||
|
|
||||||
CollectionData* array = allowArray ? &variant->toArray() : 0;
|
CollectionData * array = allowArray ? &variant->toArray() : 0;
|
||||||
|
|
||||||
TFilter memberFilter = filter[0U];
|
TFilter memberFilter = filter[0U];
|
||||||
|
|
||||||
for (; n; --n) {
|
for (; n; --n) {
|
||||||
VariantData* value;
|
VariantData * value;
|
||||||
|
|
||||||
if (memberFilter.allow()) {
|
if (memberFilter.allow()) {
|
||||||
value = array->addElement(_pool);
|
value = array->addElement(_pool);
|
||||||
@@ -442,8 +434,7 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename TSize, typename TFilter>
|
template <typename TSize, typename TFilter>
|
||||||
DeserializationError::Code readObject(VariantData* variant, TFilter filter,
|
DeserializationError::Code readObject(VariantData * variant, TFilter filter, NestingLimit nestingLimit) {
|
||||||
NestingLimit nestingLimit) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
TSize size;
|
TSize size;
|
||||||
|
|
||||||
@@ -455,15 +446,13 @@ class MsgPackDeserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename TFilter>
|
template <typename TFilter>
|
||||||
DeserializationError::Code readObject(VariantData* variant, size_t n,
|
DeserializationError::Code readObject(VariantData * variant, size_t n, TFilter filter, NestingLimit nestingLimit) {
|
||||||
TFilter filter,
|
|
||||||
NestingLimit nestingLimit) {
|
|
||||||
DeserializationError::Code err;
|
DeserializationError::Code err;
|
||||||
|
|
||||||
if (nestingLimit.reached())
|
if (nestingLimit.reached())
|
||||||
return DeserializationError::TooDeep;
|
return DeserializationError::TooDeep;
|
||||||
|
|
||||||
CollectionData* object = filter.allowObject() ? &variant->toObject() : 0;
|
CollectionData * object = filter.allowObject() ? &variant->toObject() : 0;
|
||||||
|
|
||||||
for (; n; --n) {
|
for (; n; --n) {
|
||||||
err = readKey();
|
err = readKey();
|
||||||
@@ -472,7 +461,7 @@ class MsgPackDeserializer {
|
|||||||
|
|
||||||
JsonString key = _stringStorage.str();
|
JsonString key = _stringStorage.str();
|
||||||
TFilter memberFilter = filter[key.c_str()];
|
TFilter memberFilter = filter[key.c_str()];
|
||||||
VariantData* member;
|
VariantData * member;
|
||||||
|
|
||||||
if (memberFilter.allow()) {
|
if (memberFilter.allow()) {
|
||||||
ARDUINOJSON_ASSERT(object);
|
ARDUINOJSON_ASSERT(object);
|
||||||
@@ -481,7 +470,7 @@ class MsgPackDeserializer {
|
|||||||
// This MUST be done before adding the slot.
|
// This MUST be done before adding the slot.
|
||||||
key = _stringStorage.save();
|
key = _stringStorage.save();
|
||||||
|
|
||||||
VariantSlot* slot = object->addSlot(_pool);
|
VariantSlot * slot = object->addSlot(_pool);
|
||||||
if (!slot)
|
if (!slot)
|
||||||
return DeserializationError::NoMemory;
|
return DeserializationError::NoMemory;
|
||||||
|
|
||||||
@@ -538,7 +527,7 @@ class MsgPackDeserializer {
|
|||||||
return skipBytes(size + 1U);
|
return skipBytes(size + 1U);
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryPool* _pool;
|
MemoryPool * _pool;
|
||||||
TReader _reader;
|
TReader _reader;
|
||||||
TStringStorage _stringStorage;
|
TStringStorage _stringStorage;
|
||||||
bool _foundSomething;
|
bool _foundSomething;
|
||||||
@@ -547,116 +536,85 @@ class MsgPackDeserializer {
|
|||||||
// Parses a MessagePack input and puts the result in a JsonDocument.
|
// Parses a MessagePack input and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TString>
|
template <typename TString>
|
||||||
DeserializationError deserializeMsgPack(
|
DeserializationError deserializeMsgPack(JsonDocument & doc, const TString & input, NestingLimit nestingLimit = NestingLimit()) {
|
||||||
JsonDocument& doc, const TString& input,
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, AllowAllFilter());
|
||||||
NestingLimit nestingLimit = NestingLimit()) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit,
|
|
||||||
AllowAllFilter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TString>
|
template <typename TString>
|
||||||
DeserializationError deserializeMsgPack(
|
DeserializationError deserializeMsgPack(JsonDocument & doc, const TString & input, Filter filter, NestingLimit nestingLimit = NestingLimit()) {
|
||||||
JsonDocument& doc, const TString& input, Filter filter,
|
|
||||||
NestingLimit nestingLimit = NestingLimit()) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TString>
|
template <typename TString>
|
||||||
DeserializationError deserializeMsgPack(JsonDocument& doc, const TString& input,
|
DeserializationError deserializeMsgPack(JsonDocument & doc, const TString & input, NestingLimit nestingLimit, Filter filter) {
|
||||||
NestingLimit nestingLimit,
|
|
||||||
Filter filter) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input and puts the result in a JsonDocument.
|
// Parses a MessagePack input and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TStream>
|
template <typename TStream>
|
||||||
DeserializationError deserializeMsgPack(
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TStream & input, NestingLimit nestingLimit = NestingLimit()) {
|
||||||
JsonDocument& doc, TStream& input,
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, AllowAllFilter());
|
||||||
NestingLimit nestingLimit = NestingLimit()) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit,
|
|
||||||
AllowAllFilter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TStream>
|
template <typename TStream>
|
||||||
DeserializationError deserializeMsgPack(
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TStream & input, Filter filter, NestingLimit nestingLimit = NestingLimit()) {
|
||||||
JsonDocument& doc, TStream& input, Filter filter,
|
|
||||||
NestingLimit nestingLimit = NestingLimit()) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TStream>
|
template <typename TStream>
|
||||||
DeserializationError deserializeMsgPack(JsonDocument& doc, TStream& input,
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TStream & input, NestingLimit nestingLimit, Filter filter) {
|
||||||
NestingLimit nestingLimit,
|
|
||||||
Filter filter) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input and puts the result in a JsonDocument.
|
// Parses a MessagePack input and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TChar>
|
template <typename TChar>
|
||||||
DeserializationError deserializeMsgPack(
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, NestingLimit nestingLimit = NestingLimit()) {
|
||||||
JsonDocument& doc, TChar* input,
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, AllowAllFilter());
|
||||||
NestingLimit nestingLimit = NestingLimit()) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit,
|
|
||||||
AllowAllFilter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TChar>
|
template <typename TChar>
|
||||||
DeserializationError deserializeMsgPack(
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, Filter filter, NestingLimit nestingLimit = NestingLimit()) {
|
||||||
JsonDocument& doc, TChar* input, Filter filter,
|
|
||||||
NestingLimit nestingLimit = NestingLimit()) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TChar>
|
template <typename TChar>
|
||||||
DeserializationError deserializeMsgPack(JsonDocument& doc, TChar* input,
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, NestingLimit nestingLimit, Filter filter) {
|
||||||
NestingLimit nestingLimit,
|
|
||||||
Filter filter) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
return deserialize<MsgPackDeserializer>(doc, input, nestingLimit, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input and puts the result in a JsonDocument.
|
// Parses a MessagePack input and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TChar>
|
template <typename TChar>
|
||||||
DeserializationError deserializeMsgPack(
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, size_t inputSize, NestingLimit nestingLimit = NestingLimit()) {
|
||||||
JsonDocument& doc, TChar* input, size_t inputSize,
|
return deserialize<MsgPackDeserializer>(doc, input, inputSize, nestingLimit, AllowAllFilter());
|
||||||
NestingLimit nestingLimit = NestingLimit()) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, inputSize, nestingLimit,
|
|
||||||
AllowAllFilter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TChar>
|
template <typename TChar>
|
||||||
DeserializationError deserializeMsgPack(
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, size_t inputSize, Filter filter, NestingLimit nestingLimit = NestingLimit()) {
|
||||||
JsonDocument& doc, TChar* input, size_t inputSize, Filter filter,
|
return deserialize<MsgPackDeserializer>(doc, input, inputSize, nestingLimit, filter);
|
||||||
NestingLimit nestingLimit = NestingLimit()) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, inputSize, nestingLimit,
|
|
||||||
filter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
// Parses a MessagePack input, filters, and puts the result in a JsonDocument.
|
||||||
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
// https://arduinojson.org/v6/api/msgpack/deserializemsgpack/
|
||||||
template <typename TChar>
|
template <typename TChar>
|
||||||
DeserializationError deserializeMsgPack(JsonDocument& doc, TChar* input,
|
DeserializationError deserializeMsgPack(JsonDocument & doc, TChar * input, size_t inputSize, NestingLimit nestingLimit, Filter filter) {
|
||||||
size_t inputSize,
|
return deserialize<MsgPackDeserializer>(doc, input, inputSize, nestingLimit, filter);
|
||||||
NestingLimit nestingLimit,
|
|
||||||
Filter filter) {
|
|
||||||
return deserialize<MsgPackDeserializer>(doc, input, inputSize, nestingLimit,
|
|
||||||
filter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ARDUINOJSON_NAMESPACE
|
} // namespace ARDUINOJSON_NAMESPACE
|
||||||
|
|||||||
@@ -417,7 +417,6 @@ void Shell::loop_delay() {
|
|||||||
|
|
||||||
function_copy(*this);
|
function_copy(*this);
|
||||||
|
|
||||||
// TODO comment this block out like we had < v3.5?
|
|
||||||
if (running()) {
|
if (running()) {
|
||||||
display_prompt();
|
display_prompt();
|
||||||
}
|
}
|
||||||
@@ -448,7 +447,6 @@ void Shell::loop_blocking() {
|
|||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO comment this block out like we had < v3.5?
|
|
||||||
if (running()) {
|
if (running()) {
|
||||||
display_prompt();
|
display_prompt();
|
||||||
}
|
}
|
||||||
@@ -561,7 +559,6 @@ void Shell::process_command() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO comment this block out like we had < v3.5?
|
|
||||||
if (running()) {
|
if (running()) {
|
||||||
display_prompt();
|
display_prompt();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ void SyslogService::loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SyslogService::can_transmit() {
|
bool SyslogService::can_transmit() {
|
||||||
// TODO this should be checked for Eth
|
// TODO this should be checked also for Eth
|
||||||
if (!host_.empty() && (uint32_t)ip_ == 0) {
|
if (!host_.empty() && (uint32_t)ip_ == 0) {
|
||||||
WiFi.hostByName(host_.c_str(), ip_);
|
WiFi.hostByName(host_.c_str(), ip_);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user