1#ifdef USE_ESP32_FRAMEWORK_ARDUINO
13static const char *
const TAG =
"ota.arduino_esp32";
15std::unique_ptr<ota::OTABackend>
make_ota_backend() {
return make_unique<ota::ArduinoESP32OTABackend>(); }
20 if (image_size == 0) {
21 image_size = UPDATE_SIZE_UNKNOWN;
23 bool ret = Update.begin(image_size, U_FLASH);
28 uint8_t error = Update.getError();
29 if (error == UPDATE_ERROR_SIZE)
32 ESP_LOGE(TAG,
"Begin error: %d", error);
39 this->md5_set_ =
true;
43 size_t written = Update.write(data,
len);
48 uint8_t error = Update.getError();
49 ESP_LOGE(TAG,
"Write error: %d", error);
57 if (Update.end(!this->md5_set_)) {
61 uint8_t error = Update.getError();
62 ESP_LOGE(TAG,
"End error: %d", error);
void set_update_md5(const char *md5) override
OTAResponseTypes write(uint8_t *data, size_t len) override
OTAResponseTypes end() override
OTAResponseTypes begin(size_t image_size) override
std::unique_ptr< ota::OTABackend > make_ota_backend()
@ OTA_RESPONSE_ERROR_ESP32_NOT_ENOUGH_SPACE
@ OTA_RESPONSE_ERROR_WRITING_FLASH
@ OTA_RESPONSE_ERROR_UPDATE_END
@ OTA_RESPONSE_ERROR_UNKNOWN
Providing packet encoding functions for exchanging data with a remote host.