Skip to content
This repository was archived by the owner on Dec 8, 2019. It is now read-only.

Compiling error 'StaticJsonBuffer' was not declared in this scope #103

@jccarey5

Description

@jccarey5

When compiling i get an error:

exit status 1
'StaticJsonBuffer' was not declared in this scope

This is the location of the error
/********************************** START SEND STATE*****************************************/
void sendState() {
StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;

JsonObject& root = jsonBuffer.createObject();

root["state"] = (stateOn) ? on_cmd : off_cmd;
JsonObject& color = root.createNestedObject("color");
color["r"] = red;
color["g"] = green;
color["b"] = blue;

root["brightness"] = brightness;
root["effect"] = effectString.c_str();

char buffer[root.measureLength() + 1];
root.printTo(buffer, sizeof(buffer));

client.publish(light_state_topic, buffer, true);
}

Is there a fix for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions