ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
frame_reader.h File Reference

Go to the source code of this file.

Data Structures

class  esphome::FrameReader< N, HEADER >
 Collects fixed length binary frames of N bytes that start with the header bytes HEADER...; the binary twin of LineReader. More...
 
struct  esphome::LengthField
 offset: where the length field starts, counted from the first header byte. More...
 
struct  esphome::FrameLengthU8< F >
 Whole-frame length: the field counts every byte of the frame, header included. More...
 
struct  esphome::FrameLengthU16BE< F >
 
struct  esphome::FrameLengthU16LE< F >
 
struct  esphome::frame_reader_detail::PayloadLength< F, FIELD >
 
struct  esphome::FrameFixedLength< LEN >
 A frame type that always has LEN bytes. More...
 
struct  esphome::FrameOption
 Base of the FrameFormat options; each option overrides only its own members. More...
 
struct  esphome::FrameMinLength< LEN >
 FrameFormat option: the shortest frame, when that is more than its header and length field. More...
 
struct  esphome::CheckFirstBytes< BYTES, CHECK >
 FrameFormat option: CHECK(frame) runs once the first BYTES bytes are in; a frame it fails is not a frame. More...
 
struct  esphome::WarnIfLongerThan< MAX, WARN >
 FrameFormat option: a frame longer than MAX calls WARN(length) and is skipped; a replay can warn again. More...
 
struct  esphome::FrameHeader< BYTES >
 The bytes every frame of a FrameFormat starts with. More...
 
struct  esphome::frame_reader_detail::OptionLength< LENGTH, OPTIONS >
 
struct  esphome::FrameFormat< HEADER, LENGTH, OPTIONS >
 One frame type for LengthFrameReader: a FrameHeader, a length rule from above, then any of the options FrameMinLength, CheckFirstBytes and WarnIfLongerThan. More...
 
class  esphome::LengthFrameReader< N, FORMATS >
 Collects binary frames that give their own length, of up to N bytes, in one or more FrameFormats; the first byte picks the format, so each format needs a different first header byte. More...
 

Namespaces

namespace  esphome
 
namespace  esphome::frame_reader_detail
 

Typedefs

template<LengthField F>
using esphome::PayloadLengthU8 = frame_reader_detail::PayloadLength<F, FrameLengthU8<LengthField{.offset = F.offset}>>
 Payload length: the field counts the payload, which starts at PAYLOAD_AT.
 
template<LengthField F>
using esphome::PayloadLengthU16BE = frame_reader_detail::PayloadLength<F, FrameLengthU16BE<LengthField{.offset = F.offset}>>
 
template<LengthField F>
using esphome::PayloadLengthU16LE = frame_reader_detail::PayloadLength<F, FrameLengthU16LE<LengthField{.offset = F.offset}>>
 

Functions

template<uint8_t... HEADER>
constexpr uint8_t esphome::frame_reader_detail::header_byte (size_t i)
 

Variables

template<class LENGTH >
constexpr size_t esphome::frame_reader_detail::RULE_MIN = 0
 
template<LengthField F, class FIELD >
constexpr size_t esphome::frame_reader_detail::RULE_MIN< PayloadLength< F, FIELD > > = PayloadLength<F, FIELD>::MIN
 
template<class LENGTH >
constexpr size_t esphome::frame_reader_detail::FIXED_LENGTH = 0
 
template<size_t LEN>
constexpr size_t esphome::frame_reader_detail::FIXED_LENGTH< FrameFixedLength< LEN > > = LEN