OTA works
This commit is contained in:
4
Ota.cpp
4
Ota.cpp
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user