ESPHome  2022.8.0
ota_backend_esp_idf.h
Go to the documentation of this file.
1 #pragma once
2 #include "esphome/core/defines.h"
3 #ifdef USE_ESP_IDF
4 
5 #include "ota_component.h"
6 #include "ota_backend.h"
7 #include <esp_ota_ops.h>
9 
10 namespace esphome {
11 namespace ota {
12 
13 class IDFOTABackend : public OTABackend {
14  public:
15  OTAResponseTypes begin(size_t image_size) override;
16  void set_update_md5(const char *md5) override;
17  OTAResponseTypes write(uint8_t *data, size_t len) override;
18  OTAResponseTypes end() override;
19  void abort() override;
20  bool supports_compression() override { return false; }
21 
22  private:
23  esp_ota_handle_t update_handle_{0};
24  const esp_partition_t *partition_;
25  md5::MD5Digest md5_{};
26  char expected_bin_md5_[32];
27 };
28 
29 } // namespace ota
30 } // namespace esphome
31 #endif
OTAResponseTypes begin(size_t image_size) override
std::string size_t len
Definition: helpers.h:278
Definition: a4988.cpp:4
OTAResponseTypes write(uint8_t *data, size_t len) override
void set_update_md5(const char *md5) override
OTAResponseTypes end() override