ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
esphome::hdmi_cec::Frame Class Reference

One CEC bus message: a header byte with the initiator and destination addresses, then up to 15 payload bytes of which the first is the opcode. More...

#include <hdmi_cec.h>

Public Member Functions

 Frame ()=default
 
 Frame (uint8_t initiator_addr, uint8_t destination_addr, std::span< const uint8_t > payload)
 The payload, in RAM or flash, is at most MAX_PAYLOAD_LENGTH bytes; send() checks that.
 
ESPHOME_ALWAYS_INLINE uint8_t initiator_addr () const
 
ESPHOME_ALWAYS_INLINE uint8_t destination_addr () const
 
ESPHOME_ALWAYS_INLINE bool is_broadcast () const
 
ESPHOME_ALWAYS_INLINE size_t size () const
 
ESPHOME_ALWAYS_INLINE uint8_t opcode () const
 
std::span< const uint8_t > bytes () const
 
std::span< const uint8_t > payload () const
 The bytes after the header, starting with the opcode.
 
ESPHOME_ALWAYS_INLINE void clear ()
 
ESPHOME_ALWAYS_INLINE bool push_back (uint8_t data)
 False when the frame is full already; the bus allows no more.
 

Static Public Attributes

static constexpr size_t MAX_LENGTH = 16
 
static constexpr size_t MAX_PAYLOAD_LENGTH = MAX_LENGTH - 1
 
static constexpr uint8_t BROADCAST_ADDRESS = 0xF
 

Protected Attributes

std::array< uint8_t, MAX_LENGTH > data_ {}
 
uint8_t size_ {0}
 

Detailed Description

One CEC bus message: a header byte with the initiator and destination addresses, then up to 15 payload bytes of which the first is the opcode.

Fixed storage, so the receive interrupt never allocates.

Definition at line 51 of file hdmi_cec.h.

Constructor & Destructor Documentation

◆ Frame() [1/2]

esphome::hdmi_cec::Frame::Frame ( )
default

◆ Frame() [2/2]

esphome::hdmi_cec::Frame::Frame ( uint8_t initiator_addr,
uint8_t destination_addr,
std::span< const uint8_t > payload )

The payload, in RAM or flash, is at most MAX_PAYLOAD_LENGTH bytes; send() checks that.

Definition at line 98 of file hdmi_cec.cpp.

Member Function Documentation

◆ bytes()

std::span< const uint8_t > esphome::hdmi_cec::Frame::bytes ( ) const
inline

Definition at line 67 of file hdmi_cec.h.

◆ clear()

ESPHOME_ALWAYS_INLINE void esphome::hdmi_cec::Frame::clear ( )
inline

Definition at line 70 of file hdmi_cec.h.

◆ destination_addr()

ESPHOME_ALWAYS_INLINE uint8_t esphome::hdmi_cec::Frame::destination_addr ( ) const
inline

Definition at line 62 of file hdmi_cec.h.

◆ initiator_addr()

ESPHOME_ALWAYS_INLINE uint8_t esphome::hdmi_cec::Frame::initiator_addr ( ) const
inline

Definition at line 61 of file hdmi_cec.h.

◆ is_broadcast()

ESPHOME_ALWAYS_INLINE bool esphome::hdmi_cec::Frame::is_broadcast ( ) const
inline

Definition at line 63 of file hdmi_cec.h.

◆ opcode()

ESPHOME_ALWAYS_INLINE uint8_t esphome::hdmi_cec::Frame::opcode ( ) const
inline

Definition at line 66 of file hdmi_cec.h.

◆ payload()

std::span< const uint8_t > esphome::hdmi_cec::Frame::payload ( ) const
inline

The bytes after the header, starting with the opcode.

Definition at line 69 of file hdmi_cec.h.

◆ push_back()

ESPHOME_ALWAYS_INLINE bool esphome::hdmi_cec::Frame::push_back ( uint8_t data)
inline

False when the frame is full already; the bus allows no more.

Definition at line 72 of file hdmi_cec.h.

◆ size()

ESPHOME_ALWAYS_INLINE size_t esphome::hdmi_cec::Frame::size ( ) const
inline

Definition at line 64 of file hdmi_cec.h.

Field Documentation

◆ BROADCAST_ADDRESS

uint8_t esphome::hdmi_cec::Frame::BROADCAST_ADDRESS = 0xF
staticconstexpr

Definition at line 55 of file hdmi_cec.h.

◆ data_

std::array<uint8_t, MAX_LENGTH> esphome::hdmi_cec::Frame::data_ {}
protected

Definition at line 81 of file hdmi_cec.h.

◆ MAX_LENGTH

size_t esphome::hdmi_cec::Frame::MAX_LENGTH = 16
staticconstexpr

Definition at line 53 of file hdmi_cec.h.

◆ MAX_PAYLOAD_LENGTH

size_t esphome::hdmi_cec::Frame::MAX_PAYLOAD_LENGTH = MAX_LENGTH - 1
staticconstexpr

Definition at line 54 of file hdmi_cec.h.

◆ size_

uint8_t esphome::hdmi_cec::Frame::size_ {0}
protected

Definition at line 82 of file hdmi_cec.h.


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