enlarge json buffer to hold sensor and boiler values

This commit is contained in:
MichaelDvP
2020-08-01 12:12:42 +02:00
parent 163fbba917
commit 7ca593f374
2 changed files with 4 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ void EMSESPDevicesService::scan_devices(AsyncWebServerRequest * request) {
} }
void EMSESPDevicesService::all_devices(AsyncWebServerRequest * request) { void EMSESPDevicesService::all_devices(AsyncWebServerRequest * request) {
AsyncJsonResponse * response = new AsyncJsonResponse(false, MAX_EMSESP_STATUS_SIZE); AsyncJsonResponse * response = new AsyncJsonResponse(false, MAX_EMSESP_DEVICE_SIZE);
JsonObject root = response->getRoot(); JsonObject root = response->getRoot();
JsonArray devices = root.createNestedArray("devices"); JsonArray devices = root.createNestedArray("devices");
@@ -78,7 +78,7 @@ void EMSESPDevicesService::device_data(AsyncWebServerRequest * request, JsonVari
if (json.is<JsonObject>()) { if (json.is<JsonObject>()) {
uint8_t id = json["id"]; // get id from selected table row uint8_t id = json["id"]; // get id from selected table row
AsyncJsonResponse * response = new AsyncJsonResponse(false, 1024); AsyncJsonResponse * response = new AsyncJsonResponse(false, MAX_EMSESP_DEVICE_SIZE);
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
EMSESP::device_info(id, (JsonObject &)response->getRoot()); EMSESP::device_info(id, (JsonObject &)response->getRoot());
#endif #endif

View File

@@ -24,7 +24,8 @@
#include <ESPAsyncWebServer.h> #include <ESPAsyncWebServer.h>
#include <SecurityManager.h> #include <SecurityManager.h>
#define MAX_EMSESP_STATUS_SIZE 1024 // #define MAX_EMSESP_STATUS_SIZE 1024
#define MAX_EMSESP_DEVICE_SIZE 1280
#define EMSESP_DEVICES_SERVICE_PATH "/rest/allDevices" #define EMSESP_DEVICES_SERVICE_PATH "/rest/allDevices"
#define SCAN_DEVICES_SERVICE_PATH "/rest/scanDevices" #define SCAN_DEVICES_SERVICE_PATH "/rest/scanDevices"