mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-15 05:02:21 +01:00
cleanup
This commit is contained in:
@@ -28,19 +28,18 @@ struct JsonStruct {
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
String getAttrFromJson(JsonObject& json, const char* attr){
|
||||
String getAttrFromJson(JsonObject& json, const char* attr, String defautValue = ""){
|
||||
if(json.containsKey(String(attr))){
|
||||
const char *value = json[attr];
|
||||
return String(value);
|
||||
//return json[attr];
|
||||
}
|
||||
return "no value";
|
||||
return defautValue;
|
||||
}
|
||||
int getIntAttrFromJson(JsonObject& json, const char* attr){
|
||||
int getIntAttrFromJson(JsonObject& json, const char* attr, int defautValue = 0){
|
||||
if(json.containsKey(attr)){
|
||||
return json[attr];
|
||||
}
|
||||
return 0;
|
||||
return defautValue;
|
||||
}
|
||||
// Map a json object to this struct.
|
||||
// Parse a json string and map parsed object
|
||||
|
||||
@@ -16,7 +16,6 @@ Network* MeshNet::init(){
|
||||
|
||||
Serial.println("init mesh");
|
||||
config.fromFile("/config.json");
|
||||
Serial.println(config.meshSSID);
|
||||
|
||||
//mesh.setDebugMsgTypes( ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE ); // all types on
|
||||
mesh.setDebugMsgTypes( config.debugTypes );
|
||||
|
||||
Reference in New Issue
Block a user