Skip to content

Commit 69130ab

Browse files
committed
Reduced JSON buffer for optimized memory usage.
1 parent e420aaf commit 69130ab

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/BootstrapManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class BootstrapManager {
4646

4747
public:
4848
StaticJsonDocument<BUFFER_SIZE> jsonDoc;
49+
StaticJsonDocument<BUFFER_SIZE_MAX_SIZE> jsonDocBigSize;
4950
// using JsonDocument = StaticJsonDocument<BUFFER_SIZE>;
5051
StaticJsonDocument<BUFFER_SIZE> parseQueueMsg(char* topic, byte* payload, unsigned int length); // print the message arriving from the queue
5152
void bootstrapSetup(void (*manageDisconnectionFunction)(), void (*manageHardwareButton)(), void (*callback)(char*, byte*, unsigned int)); // bootstrap setup()

src/Helpers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525

2626

2727
// Maximum JSON Object Size
28-
const int BUFFER_SIZE = JSON_OBJECT_SIZE(MAX_JSON_OBJECT_SIZE);
28+
const int BUFFER_SIZE = JSON_OBJECT_SIZE(50);
29+
const int BUFFER_SIZE_MAX_SIZE = JSON_OBJECT_SIZE(MAX_JSON_OBJECT_SIZE);
2930

3031
extern bool isConfigFileOk;
3132
extern String lastMQTTConnection;

0 commit comments

Comments
 (0)