Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Issues
  • #1432
Closed
Open
Issue created Nov 09, 2020 by Administrator@rootContributor

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;
}


Assignee
Assign to
Time tracking