From 7092f86baceb6cb9ae44029470d90f77fe95ca37 Mon Sep 17 00:00:00 2001 From: BlueAndi Date: Thu, 21 Dec 2023 20:50:25 +0100 Subject: [PATCH] JSON document size increased for topic registration. This was necessary for the ThreeIconPlugin. --- lib/TopicHandlerService/src/TopicHandlerService.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/TopicHandlerService/src/TopicHandlerService.cpp b/lib/TopicHandlerService/src/TopicHandlerService.cpp index 53b559bf..92492baf 100644 --- a/lib/TopicHandlerService/src/TopicHandlerService.cpp +++ b/lib/TopicHandlerService/src/TopicHandlerService.cpp @@ -100,13 +100,18 @@ void TopicHandlerService::registerTopics(const String& deviceId, IPluginMaintena if ((false == deviceId.isEmpty()) && (nullptr != plugin)) { - const size_t JSON_DOC_SIZE = 512U; + const size_t JSON_DOC_SIZE = 1024U; DynamicJsonDocument topicsDoc(JSON_DOC_SIZE); JsonArray jsonTopics = topicsDoc.createNestedArray("topics"); /* Get topics from plugin. */ plugin->getTopics(jsonTopics); + if (true == topicsDoc.overflowed()) + { + LOG_ERROR("JSON document has less memory available."); + } + /* Handle each topic */ if (0U < jsonTopics.size()) {