ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
ota_backend_host.h
Go to the documentation of this file.
1#pragma once
2#ifdef USE_HOST
3#include "ota_backend.h"
4
6
7#include <cstddef>
8#include <cstdint>
9#include <string>
10
11namespace esphome::ota {
12
15class HostOTABackend final {
16 public:
17 OTAResponseTypes begin(size_t image_size, OTAType ota_type = OTA_TYPE_UPDATE_APP);
18 void set_update_md5(const char *md5);
19 OTAResponseTypes write(uint8_t *data, size_t len);
21 void abort();
22 bool supports_compression() { return false; }
23
24 protected:
26 std::string staging_path_;
27 std::string final_path_;
28 size_t expected_size_{0};
29 size_t bytes_written_{0};
30 uint8_t expected_md5_[16]{};
31 int fd_{-1};
32 bool md5_set_{false};
33};
34
35std::unique_ptr<HostOTABackend> make_ota_backend();
36
37} // namespace esphome::ota
38#endif
Host OTA backend: stages new binary to <exe>.ota.new, validates ELF/Mach-O matches the running arch,...
OTAResponseTypes write(uint8_t *data, size_t len)
OTAResponseTypes begin(size_t image_size, OTAType ota_type=OTA_TYPE_UPDATE_APP)
void set_update_md5(const char *md5)
std::unique_ptr< ArduinoLibreTinyOTABackend > make_ota_backend()
std::string size_t len