upd Nextion upload

This commit is contained in:
Mit4el
2024-05-09 18:58:11 +03:00
parent 2eec5d2982
commit 3e4345e06c
2 changed files with 13 additions and 13 deletions

View File

@@ -428,7 +428,7 @@ bool ESPNexUpload::upload(Stream &myFile)
#endif #endif
// create buffer for read // create buffer for read
uint8_t buff[2048] = {0}; uint8_t buff[4096] = {0};
// read all data from server // read all data from server
while (_undownloadByte > 0 || _undownloadByte == -1) while (_undownloadByte > 0 || _undownloadByte == -1)

View File

@@ -445,22 +445,22 @@ public:
{ {
downloadFile(msg); downloadFile(msg);
} }
else if (msg.text.indexOf("Next_firmware") != -1) }
else if (msg.text.indexOf("Next_firmware") != -1)
{
// удаляем последнее сообщение от бота
_myBot->deleteMessage(_myBot->lastBotMsg());
if (msg.data.indexOf("Firmware") != -1 && OTAfilepath != "")
{ {
// удаляем последнее сообщение от бота for (std::list<IoTItem *>::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it)
_myBot->deleteMessage(_myBot->lastBotMsg());
if (msg.data.indexOf("Firmware") != -1)
{ {
for (std::list<IoTItem *>::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it) if ((*it)->getSubtype() == "NextionUpload" || (*it)->getSubtype() == "Nextion")
{ {
if ((*it)->getSubtype() == "NextionUpload" || (*it)->getSubtype() == "Nextion") _myBot->sendMessage("Nextion firmware ...", _chatID);
{ (*it)->uploadNextionTlgrm(OTAfilepath);
_myBot->sendMessage("Nextion firmware ...", _chatID);
(*it)->uploadNextionTlgrm(OTAfilepath);
}
} }
OTAfilepath = ""; }
} OTAfilepath = "";
} }
} }
// -------------- Обработка кнопок меню созданного в сценарии -------------- // -------------- Обработка кнопок меню созданного в сценарии --------------