15static const char *
const TAG =
"ota.arduino_rp2040";
17std::unique_ptr<ota::OTABackend>
make_ota_backend() {
return make_unique<ota::ArduinoRP2040OTABackend>(); }
22 bool ret = Update.begin(image_size, U_FLASH);
28 uint8_t error = Update.getError();
29 if (error == UPDATE_ERROR_BOOTSTRAP)
31 if (error == UPDATE_ERROR_NEW_FLASH_CONFIG)
33 if (error == UPDATE_ERROR_FLASH_CONFIG)
35 if (error == UPDATE_ERROR_SPACE)
38 ESP_LOGE(TAG,
"Begin error: %d", error);
45 this->md5_set_ =
true;
49 size_t written = Update.write(data,
len);
54 uint8_t error = Update.getError();
55 ESP_LOGE(TAG,
"Write error: %d", error);
63 if (Update.end(!this->md5_set_)) {
67 uint8_t error = Update.getError();
68 ESP_LOGE(TAG,
"End error: %d", error);
OTAResponseTypes begin(size_t image_size) override
void set_update_md5(const char *md5) override
OTAResponseTypes write(uint8_t *data, size_t len) override
OTAResponseTypes end() override
std::unique_ptr< ota::OTABackend > make_ota_backend()
@ OTA_RESPONSE_ERROR_WRONG_NEW_FLASH_CONFIG
@ OTA_RESPONSE_ERROR_WRONG_CURRENT_FLASH_CONFIG
@ OTA_RESPONSE_ERROR_WRITING_FLASH
@ OTA_RESPONSE_ERROR_UPDATE_END
@ OTA_RESPONSE_ERROR_RP2040_NOT_ENOUGH_SPACE
@ OTA_RESPONSE_ERROR_UNKNOWN
@ OTA_RESPONSE_ERROR_INVALID_BOOTSTRAPPING
void preferences_prevent_write(bool prevent)
Providing packet encoding functions for exchanging data with a remote host.