ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
ota_backend_arduino_rp2.h
Go to the documentation of this file.
1#pragma once
2#ifdef USE_ARDUINO
3#ifdef USE_RP2
4#include "ota_backend.h"
5
8
9namespace esphome::ota {
10
12 public:
13 OTAResponseTypes begin(size_t image_size, OTAType ota_type = OTA_TYPE_UPDATE_APP);
14 void set_update_md5(const char *md5);
15 OTAResponseTypes write(uint8_t *data, size_t len);
17 void abort();
18 // The core's OTA stub inflates a staged gzip image at reboot, on every chip
19 // from 4.0.3 (ESPHome pins 6.0.0). begin() only sees the gzip size; the
20 // inflated size is known when the stub reads the trailer.
21 static constexpr bool supports_compression() { return USE_ARDUINO_VERSION_CODE >= VERSION_CODE(4, 0, 3); }
22
23 private:
24 UpdateLock lock_;
25 bool md5_set_{false};
26};
27
28std::unique_ptr<ArduinoRP2OTABackend> make_ota_backend();
29
30} // namespace esphome::ota
31#endif // USE_RP2
32#endif // USE_ARDUINO
OTAResponseTypes begin(size_t image_size, OTAType ota_type=OTA_TYPE_UPDATE_APP)
OTAResponseTypes write(uint8_t *data, size_t len)
Serializes flash updates.
std::unique_ptr< ArduinoLibreTinyOTABackend > make_ota_backend()
const void size_t len
Definition hal.h:68