mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-24 09:07:05 +01:00
Remove unnecessary and memory inefficient code
This commit is contained in:
@@ -30,13 +30,8 @@ bool webSocketSend(uint8_t num, char * payload) {
|
||||
void webSocketParse(uint8_t num, uint8_t * payload, size_t length) {
|
||||
|
||||
// Parse JSON input
|
||||
|
||||
char buffer[length+1];
|
||||
memcpy(buffer, payload, length);
|
||||
buffer[length] = 0;
|
||||
|
||||
DynamicJsonBuffer jsonBuffer;
|
||||
JsonObject& root = jsonBuffer.parseObject(buffer);
|
||||
JsonObject& root = jsonBuffer.parseObject((char *) payload);
|
||||
if (!root.success()) {
|
||||
DEBUG_MSG("[WEBSOCKET] Error parsing data\n");
|
||||
return;
|
||||
@@ -67,6 +62,8 @@ void webSocketParse(uint8_t num, uint8_t * payload, size_t length) {
|
||||
|
||||
for (unsigned int i=0; i<config.size(); i++) {
|
||||
|
||||
yield();
|
||||
|
||||
String key = config[i]["name"];
|
||||
String value = config[i]["value"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user