ESPHome 2026.1.0
Loading...
Searching...
No Matches
esphome::api::DumpBuffer Class Reference

Fixed-size buffer for message dumps - avoids heap allocation. More...

#include <proto.h>

Public Member Functions

 DumpBuffer ()
 
DumpBufferappend (const char *str)
 
DumpBufferappend (const char *str, size_t len)
 
DumpBufferappend (size_t n, char c)
 
const char * c_str () const
 
size_t size () const
 

Static Public Attributes

static constexpr size_t CAPACITY = 512
 

Detailed Description

Fixed-size buffer for message dumps - avoids heap allocation.

Sized to match the logger's default tx_buffer_size (512 bytes) since anything larger gets truncated anyway.

Definition at line 371 of file proto.h.

Constructor & Destructor Documentation

◆ DumpBuffer()

esphome::api::DumpBuffer::DumpBuffer ( )
inline

Definition at line 376 of file proto.h.

Member Function Documentation

◆ append() [1/3]

DumpBuffer & esphome::api::DumpBuffer::append ( const char * str)
inline

Definition at line 378 of file proto.h.

◆ append() [2/3]

DumpBuffer & esphome::api::DumpBuffer::append ( const char * str,
size_t len )
inline

Definition at line 385 of file proto.h.

◆ append() [3/3]

DumpBuffer & esphome::api::DumpBuffer::append ( size_t n,
char c )
inline

Definition at line 390 of file proto.h.

◆ c_str()

const char * esphome::api::DumpBuffer::c_str ( ) const
inline

Definition at line 402 of file proto.h.

◆ size()

size_t esphome::api::DumpBuffer::size ( ) const
inline

Definition at line 403 of file proto.h.

Field Documentation

◆ CAPACITY

size_t esphome::api::DumpBuffer::CAPACITY = 512
staticconstexpr

Definition at line 374 of file proto.h.


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