|
ESPHome 2026.11.0-dev
|
Lets a decoder read a download as it arrives, from the download buffer. More...
#include <download_buffer.h>
Public Member Functions | |
| DownloadSource (DownloadBuffer &buffer) | |
| void | reset () |
| Start again at the beginning of a new download, keeping what is read. | |
| void | set_keep_read (bool keep) |
| void | compact () |
| Drop the bytes the decoder has read, to make room for more of the download. | |
| int32_t | read (uint8_t *buf, uint32_t len) override |
| bool | seek (uint32_t position) override |
Public Member Functions inherited from esphome::runtime_image::DecodeSource | |
| virtual | ~DecodeSource ()=default |
Protected Attributes | |
| DownloadBuffer & | buffer_ |
| size_t | start_ {0} |
| size_t | pos_ {0} |
| bool | keep_read_ {true} |
Lets a decoder read a download as it arrives, from the download buffer.
The decoder reads at its own position in the buffer. Bytes it has read stay there until compact() drops them, and compact() keeps everything while set_keep_read(true) is in effect, so the decoder can seek back while it reads the headers.
Definition at line 56 of file download_buffer.h.
|
inlineexplicit |
Definition at line 58 of file download_buffer.h.
| void esphome::online_image::DownloadSource::compact | ( | ) |
Drop the bytes the decoder has read, to make room for more of the download.
Definition at line 38 of file download_buffer.cpp.
|
overridevirtual |
Implements esphome::runtime_image::DecodeSource.
Definition at line 45 of file download_buffer.cpp.
|
inline |
Start again at the beginning of a new download, keeping what is read.
Definition at line 61 of file download_buffer.h.
|
overridevirtual |
Implements esphome::runtime_image::DecodeSource.
Definition at line 53 of file download_buffer.cpp.
|
inline |
Definition at line 66 of file download_buffer.h.
|
protected |
Definition at line 74 of file download_buffer.h.
|
protected |
Definition at line 77 of file download_buffer.h.
|
protected |
Definition at line 76 of file download_buffer.h.
|
protected |
Definition at line 75 of file download_buffer.h.