waterish_os_rev3_public/WaterishOS-core3.0/espcommander.cpp

16 lines
473 B
C++

#include <ArduinoJson.h>
// Copyright Siwat INC(tm) 2019
// Created by Siwat Sirichai
// ESPCommander EXTENDED v1.2
void espcommander(String topic, String rawcommand) {
StaticJsonDocument<200> doc;
DeserializationError error = deserializeJson(doc, rawcommand);
if (error) {
Serial.print(F("deserializeJson() failed: "));
Serial.println(error.c_str());
return;
}
const char* command = doc["command"];
const char* value = doc["value"];
}