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