mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 05:24:30 +01:00
remove join method as everything is handled via activate, remove commented code
This commit is contained in:
@@ -16,10 +16,8 @@ struct JsonStruct {
|
||||
virtual void fromJsonObject(JsonObject& json);
|
||||
virtual int verifyJsonObject(JsonObject& json){
|
||||
return json.success();
|
||||
//&& json.containsKey(JSON_DOMAIN)
|
||||
};
|
||||
String toJsonString(){
|
||||
//StaticJsonBuffer<200> StringjsonBuffer;
|
||||
DynamicJsonBuffer jsonBuffer(JSON_ARRAY_SIZE(300));
|
||||
JsonObject& root = jsonBuffer.createObject();
|
||||
mapJsonObject(root);
|
||||
@@ -44,7 +42,6 @@ struct JsonStruct {
|
||||
// Map a json object to this struct.
|
||||
// Parse a json string and map parsed object
|
||||
void fromJsonString(String& str){
|
||||
//StaticJsonBuffer<200> jsonBuffer;
|
||||
DynamicJsonBuffer jsonBuffer(JSON_ARRAY_SIZE(300));
|
||||
JsonObject& json = jsonBuffer.parseObject(str);
|
||||
valid = verifyJsonObject(json);
|
||||
@@ -56,13 +53,6 @@ struct JsonStruct {
|
||||
void fromFile(const char* path) {
|
||||
File configFile = SPIFFS.open(path, "r");
|
||||
String cfgFileStr = configFile.readString();
|
||||
|
||||
// Allocate a buffer to store contents of the file.
|
||||
//size_t size = configFile.size();
|
||||
//std::unique_ptr<char[]> buf(new char[size]);
|
||||
//configFile.readBytes(buf.get(), size);
|
||||
//StaticJsonBuffer<1024> jsonBuffer;
|
||||
//JsonObject& json = jsonBuffer.parseObject(buf.get());
|
||||
DynamicJsonBuffer jsonBuffer;
|
||||
JsonObject& json = jsonBuffer.parseObject(cfgFileStr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user