ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
esphome::ota::HostOTABackend Class Referencefinal

Host OTA backend: stages new binary to <exe>.ota.new, validates ELF/Mach-O matches the running arch, renames over <exe>, and arms execv via arch_restart(). More...

#include <ota_backend_host.h>

Public Member Functions

OTAResponseTypes begin (size_t image_size, OTAType ota_type=OTA_TYPE_UPDATE_APP)
 
void set_update_md5 (const char *md5)
 
OTAResponseTypes write (uint8_t *data, size_t len)
 
OTAResponseTypes end ()
 
void abort ()
 
bool supports_compression ()
 

Protected Attributes

md5::MD5Digest md5_ {}
 
std::string staging_path_
 
std::string final_path_
 
size_t expected_size_ {0}
 
size_t bytes_written_ {0}
 
uint8_t expected_md5_ [16] {}
 
int fd_ {-1}
 
bool md5_set_ {false}
 

Detailed Description

Host OTA backend: stages new binary to <exe>.ota.new, validates ELF/Mach-O matches the running arch, renames over <exe>, and arms execv via arch_restart().

Definition at line 15 of file ota_backend_host.h.

Member Function Documentation

◆ abort()

void esphome::ota::HostOTABackend::abort ( )

Definition at line 324 of file ota_backend_host.cpp.

◆ begin()

OTAResponseTypes esphome::ota::HostOTABackend::begin ( size_t image_size,
OTAType ota_type = OTA_TYPE_UPDATE_APP )

Definition at line 202 of file ota_backend_host.cpp.

◆ end()

OTAResponseTypes esphome::ota::HostOTABackend::end ( )

Definition at line 269 of file ota_backend_host.cpp.

◆ set_update_md5()

void esphome::ota::HostOTABackend::set_update_md5 ( const char * md5)

Definition at line 237 of file ota_backend_host.cpp.

◆ supports_compression()

bool esphome::ota::HostOTABackend::supports_compression ( )
inline

Definition at line 22 of file ota_backend_host.h.

◆ write()

OTAResponseTypes esphome::ota::HostOTABackend::write ( uint8_t * data,
size_t len )

Definition at line 242 of file ota_backend_host.cpp.

Field Documentation

◆ bytes_written_

size_t esphome::ota::HostOTABackend::bytes_written_ {0}
protected

Definition at line 29 of file ota_backend_host.h.

◆ expected_md5_

uint8_t esphome::ota::HostOTABackend::expected_md5_[16] {}
protected

Definition at line 30 of file ota_backend_host.h.

◆ expected_size_

size_t esphome::ota::HostOTABackend::expected_size_ {0}
protected

Definition at line 28 of file ota_backend_host.h.

◆ fd_

int esphome::ota::HostOTABackend::fd_ {-1}
protected

Definition at line 31 of file ota_backend_host.h.

◆ final_path_

std::string esphome::ota::HostOTABackend::final_path_
protected

Definition at line 27 of file ota_backend_host.h.

◆ md5_

md5::MD5Digest esphome::ota::HostOTABackend::md5_ {}
protected

Definition at line 25 of file ota_backend_host.h.

◆ md5_set_

bool esphome::ota::HostOTABackend::md5_set_ {false}
protected

Definition at line 32 of file ota_backend_host.h.

◆ staging_path_

std::string esphome::ota::HostOTABackend::staging_path_
protected

Definition at line 26 of file ota_backend_host.h.


The documentation for this class was generated from the following files: