Replace deprecated StaticJsonDocument type
This commit is contained in:
@@ -39,7 +39,7 @@ void disconnect_mqtt(PubSubClient &client, const char *topic) {
|
||||
}
|
||||
|
||||
size_t construct_json(float *data, char *buffer, int buffer_size) {
|
||||
StaticJsonDocument<100> json;
|
||||
JsonDocument json;
|
||||
json["temperature"] = data[0];
|
||||
json["humidity"] = data[1];
|
||||
size_t payload_size = serializeJson(json, buffer, buffer_size);
|
||||
|
||||
Reference in New Issue
Block a user