mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
upd Nextion upload
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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 = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// -------------- Обработка кнопок меню созданного в сценарии --------------
|
// -------------- Обработка кнопок меню созданного в сценарии --------------
|
||||||
|
|||||||
Reference in New Issue
Block a user