ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
esphome::api::ProtoLengthDelimited Class Reference

#include <proto.h>

Public Member Functions

 ProtoLengthDelimited (const uint8_t *value, size_t length)
 
std::string as_string () const
 
const uint8_t * data () const
 
size_t size () const
 
void decode_to_message (ProtoDecodableMessage &msg) const
 Decode the length-delimited data into an existing ProtoDecodableMessage instance.
 

Protected Attributes

const uint8_t *const value_
 
const size_t length_
 

Detailed Description

Definition at line 187 of file proto.h.

Constructor & Destructor Documentation

◆ ProtoLengthDelimited()

esphome::api::ProtoLengthDelimited::ProtoLengthDelimited ( const uint8_t * value,
size_t length )
inlineexplicit

Definition at line 189 of file proto.h.

Member Function Documentation

◆ as_string()

std::string esphome::api::ProtoLengthDelimited::as_string ( ) const
inline

Definition at line 190 of file proto.h.

◆ data()

const uint8_t * esphome::api::ProtoLengthDelimited::data ( ) const
inline

Definition at line 193 of file proto.h.

◆ decode_to_message()

void esphome::api::ProtoLengthDelimited::decode_to_message ( ProtoDecodableMessage & msg) const
inline

Decode the length-delimited data into an existing ProtoDecodableMessage instance.

This method allows decoding without templates, enabling use in contexts where the message type is not known at compile time. The ProtoDecodableMessage's decode() method will be called with the raw data and length.

Parameters
msgThe ProtoDecodableMessage instance to decode into

Definition at line 824 of file proto.h.

◆ size()

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

Definition at line 194 of file proto.h.

Field Documentation

◆ length_

const size_t esphome::api::ProtoLengthDelimited::length_
protected

Definition at line 209 of file proto.h.

◆ value_

const uint8_t* const esphome::api::ProtoLengthDelimited::value_
protected

Definition at line 208 of file proto.h.


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