ESPHome 2025.8.0b1
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
 
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 180 of file proto.h.

Constructor & Destructor Documentation

◆ ProtoLengthDelimited()

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

Definition at line 182 of file proto.h.

Member Function Documentation

◆ as_string()

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

Definition at line 183 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 786 of file proto.h.

Field Documentation

◆ length_

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

Definition at line 198 of file proto.h.

◆ value_

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

Definition at line 197 of file proto.h.


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