mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
Расставляем маркеры для понимания процесса очистки конфигурации
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
class iarduino_RTC_NTP: public iarduino_RTC_BASE {
|
||||
public:
|
||||
iarduino_RTC_NTP();
|
||||
~iarduino_RTC_NTP();
|
||||
void begin(void);
|
||||
uint8_t funcReadTimeIndex(uint8_t i);
|
||||
void funcWriteTimeIndex(uint8_t i, uint8_t j);
|
||||
|
||||
@@ -34,6 +34,7 @@ void configure(String path) {
|
||||
// пробуем спросить драйвер RTC
|
||||
iarduino_RTC_BASE* rtctmp = myIoTItem->getRtcDriver();
|
||||
if (rtctmp) {
|
||||
Serial.println("Start delete watch objClass");
|
||||
delete watch->objClass;
|
||||
watch->objClass = rtctmp;
|
||||
int valPeriod_save = watch->valPeriod;
|
||||
@@ -54,6 +55,7 @@ void configure(String path) {
|
||||
void clearConfigure() {
|
||||
Serial.printf("Start clearing config\n");
|
||||
for (std::list<IoTItem*>::iterator it=IoTItems.begin(); it != IoTItems.end(); ++it) {
|
||||
Serial.printf("Start delete iotitem %s \n", (*it)->getID().c_str());
|
||||
if (*it) delete *it;
|
||||
}
|
||||
IoTItems.clear();
|
||||
|
||||
@@ -69,7 +69,9 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
|
||||
//**сохранение**//
|
||||
if (headerStr == "/gifnoc|") {
|
||||
writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256);
|
||||
Serial.println("Start clear");
|
||||
clearConfigure();
|
||||
Serial.println("Start config");
|
||||
configure("/config.json");
|
||||
}
|
||||
//**сохранение**//
|
||||
|
||||
@@ -40,3 +40,7 @@ void iarduino_RTC_NTP::funcWriteTimeIndex(uint8_t i, uint8_t j) {
|
||||
|
||||
}
|
||||
|
||||
iarduino_RTC_NTP::~iarduino_RTC_NTP() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user