waterish_os_rev3_public/WaterishOS-core3.0/espcommander.cpp

15 lines
460 B
C++
Raw Normal View History

2019-08-21 14:01:13 +00:00
// Copyright Siwat INC(tm) 2019
// Created by Siwat Sirichai
// ESPCommander EXTENDED v1.2
void espcommander(String topic, String command) { //the command is in json format!
StaticJsonDocument<200> doc;
DeserializationError error = deserializeJson(doc, json);
if (error) {
Serial.print(F("deserializeJson() failed: "));
Serial.println(error.c_str());
return;
}
String command = doc["command"];
String value = doc["value"];
}