BUG ON UPDATE
Created by: laercionit
I am not able to identify the error, but it is having a problem in the compilation after the update. Can someone guide me please?
D:\SETUP\Programas\Desenvolvimento\ArduinoDesenv\portable\sketchbook\libraries\ArduinoJson\src/ArduinoJson/Variant/VariantOperators.hpp: In instantiation of 'typename ArduinoJson6171_91::enable_if<(! ArduinoJson6171_91::IsVariant::value), T>::type ArduinoJson6171_91::operator|(const TVariant&, T) [with T = char*; TVariant = ArduinoJson6171_91::MemberProxy<ArduinoJson6171_91::ObjectRef, const __FlashStringHelper*>; typename ArduinoJson6171_91::enable_if<(! ArduinoJson6171_91::IsVariant::value), T>::type = char*]': C:\Users\Laercio\AppData\Local\Temp\arduino_build_217137\sketch\Sensor.h:287:86: required from here D:\SETUP\Programas\Desenvolvimento\ArduinoDesenv\portable\sketchbook\libraries\ArduinoJson\src/ArduinoJson/Variant/VariantOperators.hpp:26:37: error: invalid conversion from 'ArduinoJson6171_91::VariantAs<char*>::type {aka const char*}' to 'ArduinoJson6171_91::enable_if<true, char*>::type {aka char*}' [-fpermissive] return variant.template as(); ^
bool SensorLoadSD(const char* Filename, const byte Total = SensorTotal) {
if (FilesSDOpen(Filename)) {
MyFileSD.find("[");
byte ObjectID = 0;
do {
DynamicJsonDocument JSON(JsonSettingsBuffer);
DeserializationError err = deserializeJson(JSON, MyFileSD);
if (!err) {
JsonObject Object = JSON.as<JsonObject>();
Sensor[ObjectID].ID = Object[F("ID")] | Sensor[ObjectID].ID;
Sensor[ObjectID].Pin = Object[F("PIN")] | Sensor[ObjectID].Pin;
Sensor[ObjectID].Type = Object[F("TP")] | Sensor[ObjectID].Type;
Sensor[ObjectID].Model = Object[F("MDL")] | Sensor[ObjectID].Model;
strlcpy(Sensor[ObjectID].Name , Object[F("NM")] | Sensor[ObjectID].Name, sizeof(Sensor[ObjectID].Name)); // ERROR COM COMPILE
Sensor[ObjectID].Rate = Object[F("RT")] | Sensor[ObjectID].Rate;
Sensor[ObjectID].LowAlert = Object[F("LW")] | Sensor[ObjectID].LowAlert;
Sensor[ObjectID].HighAlert = Object[F("HG")] | Sensor[ObjectID].HighAlert;
Sensor[ObjectID].Favorite = Object[F("FAV")] | Sensor[ObjectID].Favorite;
ObjectID++;
} else return 0;
} while ((MyFileSD.findUntil(",", "]")) && (MyFileSD.available()) && (ObjectID < Total));
String Formated = F("SensorLoadSD: %s"); snprintf_P(Buffer, sizeof(Buffer), Formated.c_str(), Filename); DebugSerial.println(Buffer);
FilesSDClose();
return 1;
}
return 0;
}