mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-03-05 04:53:51 +01:00
remove writing config if file not exists
This commit is contained in:
parent
aa1dd47810
commit
53bbc86801
|
|
@ -16,12 +16,7 @@ ConfigurationManagement::ConfigurationManagement(String FilePath)
|
|||
return;
|
||||
}
|
||||
}
|
||||
if(!SPIFFS.exists(mFilePath))
|
||||
{
|
||||
Configuration conf;
|
||||
writeConfiguration(conf);
|
||||
}
|
||||
}
|
||||
|
||||
Configuration ConfigurationManagement::readConfiguration()
|
||||
{
|
||||
|
|
@ -32,7 +27,11 @@ Configuration ConfigurationManagement::readConfiguration()
|
|||
return Configuration();
|
||||
}
|
||||
DynamicJsonDocument data(2048);
|
||||
deserializeJson(data, file);
|
||||
DeserializationError error = deserializeJson(data, file);
|
||||
if(error)
|
||||
{
|
||||
Serial.println("Failed to read file, using default configuration.");
|
||||
}
|
||||
//serializeJson(data, Serial);
|
||||
//Serial.println();
|
||||
file.close();
|
||||
|
|
|
|||
Loading…
Reference in a new issue