ESPHome
2026.11.0-dev
Loading...
Searching...
No Matches
esphome
components
ota
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
6
#include "
esphome/core/defines.h
"
7
#include "
esphome/core/macros.h
"
8
9
namespace
esphome::ota
{
10
11
class
ArduinoRP2OTABackend
final {
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
);
16
OTAResponseTypes
end
();
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
28
std::unique_ptr<ArduinoRP2OTABackend>
make_ota_backend
();
29
30
}
// namespace esphome::ota
31
#endif
// USE_RP2
32
#endif
// USE_ARDUINO
esphome::ota::ArduinoRP2OTABackend
Definition
ota_backend_arduino_rp2.h:11
esphome::ota::ArduinoRP2OTABackend::supports_compression
static constexpr bool supports_compression()
Definition
ota_backend_arduino_rp2.h:21
esphome::ota::ArduinoRP2OTABackend::set_update_md5
void set_update_md5(const char *md5)
Definition
ota_backend_arduino_rp2.cpp:47
esphome::ota::ArduinoRP2OTABackend::begin
OTAResponseTypes begin(size_t image_size, OTAType ota_type=OTA_TYPE_UPDATE_APP)
Definition
ota_backend_arduino_rp2.cpp:18
esphome::ota::ArduinoRP2OTABackend::end
OTAResponseTypes end()
Definition
ota_backend_arduino_rp2.cpp:64
esphome::ota::ArduinoRP2OTABackend::write
OTAResponseTypes write(uint8_t *data, size_t len)
Definition
ota_backend_arduino_rp2.cpp:52
esphome::ota::ArduinoRP2OTABackend::abort
void abort()
Definition
ota_backend_arduino_rp2.cpp:78
esphome::ota::UpdateLock
Serializes flash updates.
Definition
ota_backend.h:101
defines.h
macros.h
esphome::ota
Definition
automation.h:7
esphome::ota::OTAType
OTAType
Definition
ota_backend.h:93
esphome::ota::OTA_TYPE_UPDATE_APP
@ OTA_TYPE_UPDATE_APP
Definition
ota_backend.h:94
esphome::ota::OTAResponseTypes
OTAResponseTypes
Definition
ota_backend.h:18
esphome::ota::make_ota_backend
std::unique_ptr< ArduinoLibreTinyOTABackend > make_ota_backend()
Definition
ota_backend_arduino_libretiny.cpp:14
esphome::len
const void size_t len
Definition
hal.h:68
ota_backend.h
Generated by
1.12.0