Skip to content

Failed compile using 5.7.0 #381

Closed
Closed
@sticilface

Description

@sticilface

I'm not entirely sure what is going on here, or why, but this line causes my compilation to fail. whereas the same line in an example ino does not.

set.STA.MAC[i] = STAjson[string_MAC][i]; 

set.STA.MAC is a 6 byte uin8_t array. but using a temp uint8_t or anything else does not work either.

STAjson is defined as

        JsonObject & STAjson = root[string_STA].as<JsonObject>();

the string_ are static const char * to simple strings...

the error is below

In file included from .piolibdeps/ArduinoJson_ID64/include/ArduinoJson.hpp:12:0,
from .piolibdeps/ArduinoJson_ID64/include/ArduinoJson.h:8,
from .piolibdeps/ArduinoJson_ID64/ArduinoJson.h:8,
from lib/ESPManager/src/ESPmanager.h:48,
from lib/ESPManager/src/ESPmanager.cpp:2:
.piolibdeps/ArduinoJson_ID64/include/ArduinoJson/JsonObject.hpp: In instantiation of 'ArduinoJson::Internals::List<ArduinoJson::JsonPair>::node_type* ArduinoJson::JsonObject::getNodeAtImpl(TStringRef) const [with TStringRef = const unsigned char&; ArduinoJson::Internals::List<ArduinoJson::JsonPair>::node_type = ArduinoJson::Internals::ListNode<ArduinoJson::JsonPair>]':
.piolibdeps/ArduinoJson_ID64/include/ArduinoJson/JsonObject.hpp:141:68:   required from 'ArduinoJson::Internals::List<ArduinoJson::JsonPair>::node_type* ArduinoJson::JsonObject::getNodeAt(const TString&) const [with TString = unsigned char; ArduinoJson::Internals::List<ArduinoJson::JsonPair>::node_type = ArduinoJson::Internals::ListNode<ArduinoJson::JsonPair>]'
.piolibdeps/ArduinoJson_ID64/include/ArduinoJson/JsonObject.hpp:93:36:   required from 'typename ArduinoJson::Internals::JsonVariantAs<T>::type ArduinoJson::JsonObject::get(const TString&) const [with TValue = unsigned char; TString = const unsigned char&; typename ArduinoJson::Internals::JsonVariantAs<T>::type = unsigned char]'
.piolibdeps/ArduinoJson_ID64/include/ArduinoJson/Internals/../JsonObjectSubscript.hpp:52:48:   required from 'typename ArduinoJson::Internals::JsonVariantAs<T>::type ArduinoJson::JsonObjectSubscript<TKey>::as() const [with TValue = unsigned char; TString = unsigned char; typename ArduinoJson::Internals::JsonVariantAs<T>::type = unsigned char]'
.piolibdeps/ArduinoJson_ID64/include/ArduinoJson/Internals/../JsonVariantBase.hpp:60:35:   required from 'const typename ArduinoJson::Internals::JsonVariantAs<T>::type ArduinoJson::JsonVariantBase<TImpl>::as() const [with T = unsigned char; TImpl = ArduinoJson::JsonObjectSubscript<unsigned char>; typename ArduinoJson::Internals::JsonVariantAs<T>::type = unsigned char]'
.piolibdeps/ArduinoJson_ID64/include/ArduinoJson/Internals/../JsonVariantBase.hpp:55:14:   required from 'ArduinoJson::JsonVariantBase<TImpl>::operator T() const [with T = unsigned char; TImpl = ArduinoJson::JsonObjectSubscript<unsigned char>]'
lib/ESPManager/src/ESPmanager.cpp:3028:32:   required from here
.piolibdeps/ArduinoJson_ID64/include/ArduinoJson/JsonObject.hpp:147:76: error: 'equals' is not a member of 'ArduinoJson::Internals::StringFuncs<const unsigned char&>'
if (Internals::StringFuncs<TStringRef>::equals(key, node->content.key))
^
*** [.pioenvs/bedroom/lib/ESPManager/ESPmanager.o] Error 1

it happens in platformio and arduino, and only for the latest 5.7.0 version.

if i change the code to


            JsonArray & mac = STAjson[string_MAC];

            for (uint8_t i = 0; i < 6; i++) {
                set.STA.MAC[i] = mac[i]; 
            }

then it works.

bit of a loss really

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions