mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 03:49:13 +03:00
303 arduino json 6
This commit is contained in:
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define FIRMWARE_VERSION 302
|
#define FIRMWARE_VERSION 303
|
||||||
|
|
||||||
//#define svelte
|
//#define svelte
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ AsyncWebSocket ws;
|
|||||||
//AsyncEventSource events;
|
//AsyncEventSource events;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TickerScheduler ts(TIMES + 1);
|
TickerScheduler ts(MYTEST + 1);
|
||||||
WiFiClient espClient;
|
WiFiClient espClient;
|
||||||
PubSubClient mqtt(espClient);
|
PubSubClient mqtt(espClient);
|
||||||
StringCommand sCmd;
|
StringCommand sCmd;
|
||||||
|
|||||||
@@ -5,63 +5,7 @@
|
|||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
#include "Utils/FileUtils.h"
|
#include "Utils/FileUtils.h"
|
||||||
|
|
||||||
//String jsonReadStr(String& json, String name) {
|
//=================================================================================
|
||||||
// DynamicJsonBuffer jsonBuffer;
|
|
||||||
// JsonObject& root = jsonBuffer.parseObject(json);
|
|
||||||
// return root[name].as<String>();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//boolean jsonReadBool(String& json, String name) {
|
|
||||||
// DynamicJsonBuffer jsonBuffer;
|
|
||||||
// JsonObject& root = jsonBuffer.parseObject(json);
|
|
||||||
// return root[name].as<boolean>();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//int jsonReadInt(String& json, String name) {
|
|
||||||
// DynamicJsonBuffer jsonBuffer;
|
|
||||||
// JsonObject& root = jsonBuffer.parseObject(json);
|
|
||||||
// return root[name];
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//String jsonWriteStr(String& json, String name, String value) {
|
|
||||||
// DynamicJsonBuffer jsonBuffer;
|
|
||||||
// JsonObject& root = jsonBuffer.parseObject(json);
|
|
||||||
// root[name] = value;
|
|
||||||
// json = "";
|
|
||||||
// root.printTo(json);
|
|
||||||
// return json;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//String jsonWriteBool(String& json, String name, boolean value) {
|
|
||||||
// return jsonWriteStr(json, name, value ? "1" : "0");
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//String jsonWriteInt(String& json, String name, int value) {
|
|
||||||
// DynamicJsonBuffer jsonBuffer;
|
|
||||||
// JsonObject& root = jsonBuffer.parseObject(json);
|
|
||||||
// root[name] = value;
|
|
||||||
// json = "";
|
|
||||||
// root.printTo(json);
|
|
||||||
// return json;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//String jsonWriteFloat(String& json, String name, float value) {
|
|
||||||
// DynamicJsonBuffer jsonBuffer;
|
|
||||||
// JsonObject& root = jsonBuffer.parseObject(json);
|
|
||||||
// root[name] = value;
|
|
||||||
// json = "";
|
|
||||||
// root.printTo(json);
|
|
||||||
// return json;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//void saveConfig() {
|
|
||||||
// writeFile(String("config.json"), configSetupJson);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//void saveStore() {
|
|
||||||
// writeFile(String("store.json"), configStoreJson);
|
|
||||||
//}
|
|
||||||
|
|
||||||
String jsonReadStr(String& json, String name) {
|
String jsonReadStr(String& json, String name) {
|
||||||
DynamicJsonDocument doc(JSON_BUFFER_SIZE);
|
DynamicJsonDocument doc(JSON_BUFFER_SIZE);
|
||||||
DeserializationError error = deserializeJson(doc, json);
|
DeserializationError error = deserializeJson(doc, json);
|
||||||
@@ -124,6 +68,7 @@ String jsonWriteFloat(String& json, String name, float value) {
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
void saveConfig() {
|
void saveConfig() {
|
||||||
writeFile(String("config.json"), configSetupJson);
|
writeFile(String("config.json"), configSetupJson);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user