OTA works

This commit is contained in:
technyon
2022-06-14 22:50:14 +02:00
parent b39c051027
commit d64975c5ef
5 changed files with 14 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
#define FULL_PACKET 1436 // HTTP_UPLOAD_BUFLEN in WebServer,h
void Ota::updateFirmware(uint8_t buf, size_t size)
void Ota::updateFirmware(uint8_t* buf, size_t size)
{
if (!_updateFlag)
{ //If it's the first packet of OTA since bootup, begin OTA
@@ -11,7 +11,7 @@ void Ota::updateFirmware(uint8_t buf, size_t size)
esp_ota_begin(esp_ota_get_next_update_partition(NULL), OTA_SIZE_UNKNOWN, &otaHandler);
_updateFlag = true;
}
esp_ota_write(otaHandler, (const void*)buf, size);
esp_ota_write(otaHandler, buf, size);
if (size != FULL_PACKET)
{
esp_ota_end(otaHandler);