This commit is contained in:
Dmitry Borisenko
2022-08-23 13:15:11 +02:00
parent 99e2fcfcb8
commit c3f37fcf11

View File

@@ -929,14 +929,14 @@ void IoTScenario::loadScenario(String fileName) { // посимвольно с
File myfile = seekFile(fileName); File myfile = seekFile(fileName);
if (myfile.available()) { if (myfile.available()) {
strFromFile = new String(""); String strFromFile = "";
*strFromFile = myfile.readString(); strFromFile = myfile.readString();
Serial.println(*strFromFile); Serial.println(strFromFile);
jsonRead(*strFromFile, "scen", *strFromFile, true); jsonRead(strFromFile, "scen", strFromFile, true);
myfile.close(); myfile.close();
getNextToken(); getNextToken();
while (strIterator < strFromFile->length() - 1) { while (strIterator < strFromFile.length() - 1) {
// Serial.printf("-%c", LastChar); // Serial.printf("-%c", LastChar);
switch (CurTok) { switch (CurTok) {
// case tok_eof: return; // case tok_eof: return;
@@ -952,7 +952,7 @@ void IoTScenario::loadScenario(String fileName) { // посимвольно с
break; break;
} }
} }
delete strFromFile; // delete strFromFile;
strIterator = 0; strIterator = 0;
} else { } else {
Error("Open file scenario error"); Error("Open file scenario error");