12static const char *
const TAG =
"ota.arduino_libretiny";
14std::unique_ptr<ArduinoLibreTinyOTABackend>
make_ota_backend() {
return make_unique<ArduinoLibreTinyOTABackend>(); }
19 if (image_size == 0) {
20 image_size = UPDATE_SIZE_UNKNOWN;
22 bool ret = Update.begin(image_size, U_FLASH);
27 uint8_t error = Update.getError();
28 if (error == UPDATE_ERROR_SIZE)
31 ESP_LOGE(TAG,
"Begin error: %d", error);
38 this->md5_set_ =
true;
47 uint8_t error = Update.getError();
48 ESP_LOGE(TAG,
"Write error: %d", error);
56 if (Update.end(!this->md5_set_)) {
60 uint8_t error = Update.getError();
61 ESP_LOGE(TAG,
"End error: %d", error);
void set_update_md5(const char *md5)
OTAResponseTypes begin(size_t image_size)
OTAResponseTypes write(uint8_t *data, size_t len)
@ OTA_RESPONSE_ERROR_ESP32_NOT_ENOUGH_SPACE
@ OTA_RESPONSE_ERROR_WRITING_FLASH
@ OTA_RESPONSE_ERROR_UPDATE_END
@ OTA_RESPONSE_ERROR_UNKNOWN
std::unique_ptr< ArduinoLibreTinyOTABackend > make_ota_backend()