Skip to content

Commit

Permalink
Fixed compatibility with ArduinoJson 5.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon authored Jun 28, 2017
1 parent 528a4f7 commit b4245f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Homie/Boot/BootConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void BootConfig::setup() {
}

void BootConfig::_generateNetworksJson() {
DynamicJsonBuffer generatedJsonBuffer = DynamicJsonBuffer(JSON_OBJECT_SIZE(1) + JSON_ARRAY_SIZE(this->_ssidCount) + (this->_ssidCount * JSON_OBJECT_SIZE(3))); // 1 at root, 3 in childrend
DynamicJsonBuffer generatedJsonBuffer(JSON_OBJECT_SIZE(1) + JSON_ARRAY_SIZE(this->_ssidCount) + (this->_ssidCount * JSON_OBJECT_SIZE(3))); // 1 at root, 3 in childrend
JsonObject& json = generatedJsonBuffer.createObject();

int jsonLength = 15; // {"networks":[]}
Expand Down Expand Up @@ -110,7 +110,7 @@ void BootConfig::_generateNetworksJson() {
void BootConfig::_onDeviceInfoRequest() {
this->_interface->logger->logln(F("Received device info request"));

DynamicJsonBuffer jsonBuffer = DynamicJsonBuffer(JSON_OBJECT_SIZE(4) + JSON_OBJECT_SIZE(2) + JSON_ARRAY_SIZE(this->_interface->registeredNodesCount) + (this->_interface->registeredNodesCount * JSON_OBJECT_SIZE(2)));
DynamicJsonBuffer jsonBuffer(JSON_OBJECT_SIZE(4) + JSON_OBJECT_SIZE(2) + JSON_ARRAY_SIZE(this->_interface->registeredNodesCount) + (this->_interface->registeredNodesCount * JSON_OBJECT_SIZE(2)));
int jsonLength = 82; // {"device_id":"","homie_version":"","firmware":{"name":"","version":""},"nodes":[]}
JsonObject& json = jsonBuffer.createObject();
jsonLength += strlen(Helpers::getDeviceId());
Expand Down

0 comments on commit b4245f5

Please sign in to comment.