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;
|
||||||
@@ -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,8 +305,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 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
|
||||||
@@ -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())
|
||||||
@@ -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,9 +446,7 @@ 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())
|
||||||
@@ -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