ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
esphome::FrameFormat< HEADER, LENGTH, OPTIONS > Struct Template Reference

One frame type for LengthFrameReader: a FrameHeader, a length rule from above, then any of the options FrameMinLength, CheckFirstBytes and WarnIfLongerThan. More...

#include <frame_reader.h>

Public Types

using Length = frame_reader_detail::OptionLength<LENGTH, OPTIONS...>
 

Static Public Member Functions

static constexpr uint8_t header_byte (size_t i)
 

Static Public Attributes

static constexpr size_t HEADER_LEN = HEADER::LEN
 
static constexpr uint8_t FIRST = HEADER::byte(0)
 
static constexpr size_t FIXED_LENGTH = frame_reader_detail::FIXED_LENGTH<LENGTH>
 
static constexpr size_t WARN_MAX = std::max<size_t>({0, OPTIONS::WARN_MAX...})
 
static constexpr size_t MIN_LEN = std::max<size_t>({Length::KNOWN_AT, HEADER_LEN, 2})
 
static constexpr size_t SHORTEST
 

Detailed Description

template<class HEADER, class LENGTH, class... 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.

Definition at line 190 of file frame_reader.h.

Member Typedef Documentation

◆ Length

template<class HEADER , class LENGTH , class... OPTIONS>
using esphome::FrameFormat< HEADER, LENGTH, OPTIONS >::Length = frame_reader_detail::OptionLength<LENGTH, OPTIONS...>

Definition at line 199 of file frame_reader.h.

Member Function Documentation

◆ header_byte()

template<class HEADER , class LENGTH , class... OPTIONS>
static constexpr uint8_t esphome::FrameFormat< HEADER, LENGTH, OPTIONS >::header_byte ( size_t i)
inlinestaticconstexpr

Definition at line 209 of file frame_reader.h.

Field Documentation

◆ FIRST

template<class HEADER , class LENGTH , class... OPTIONS>
uint8_t esphome::FrameFormat< HEADER, LENGTH, OPTIONS >::FIRST = HEADER::byte(0)
staticconstexpr

Definition at line 201 of file frame_reader.h.

◆ FIXED_LENGTH

template<class HEADER , class LENGTH , class... OPTIONS>
size_t esphome::FrameFormat< HEADER, LENGTH, OPTIONS >::FIXED_LENGTH = frame_reader_detail::FIXED_LENGTH<LENGTH>
staticconstexpr

Definition at line 202 of file frame_reader.h.

◆ HEADER_LEN

template<class HEADER , class LENGTH , class... OPTIONS>
size_t esphome::FrameFormat< HEADER, LENGTH, OPTIONS >::HEADER_LEN = HEADER::LEN
staticconstexpr

Definition at line 200 of file frame_reader.h.

◆ MIN_LEN

template<class HEADER , class LENGTH , class... OPTIONS>
size_t esphome::FrameFormat< HEADER, LENGTH, OPTIONS >::MIN_LEN = std::max<size_t>({Length::KNOWN_AT, HEADER_LEN, 2})
staticconstexpr

Definition at line 204 of file frame_reader.h.

◆ SHORTEST

template<class HEADER , class LENGTH , class... OPTIONS>
size_t esphome::FrameFormat< HEADER, LENGTH, OPTIONS >::SHORTEST
staticconstexpr
Initial value:
=
std::max<size_t>({MIN_LEN, frame_reader_detail::RULE_MIN<LENGTH>, OPTIONS::MIN...})
static constexpr size_t MIN_LEN

Definition at line 206 of file frame_reader.h.

◆ WARN_MAX

template<class HEADER , class LENGTH , class... OPTIONS>
size_t esphome::FrameFormat< HEADER, LENGTH, OPTIONS >::WARN_MAX = std::max<size_t>({0, OPTIONS::WARN_MAX...})
staticconstexpr

Definition at line 203 of file frame_reader.h.


The documentation for this struct was generated from the following file: