ESPHome 2026.3.3
Loading...
Searching...
No Matches
proto.h File Reference

Go to the source code of this file.

Data Structures

struct  esphome::api::ProtoVarIntResult
 Result of parsing a varint: value + number of bytes consumed. More...
 
class  esphome::api::ProtoVarInt
 Static varint parsing methods for the protobuf wire format. More...
 
class  esphome::api::ProtoLengthDelimited
 
class  esphome::api::Proto32Bit
 
class  esphome::api::ProtoWriteBuffer
 
class  esphome::api::DumpBuffer
 Fixed-size buffer for message dumps - avoids heap allocation. More...
 
class  esphome::api::ProtoMessage
 
class  esphome::api::ProtoDecodableMessage
 
class  esphome::api::ProtoSize
 
class  esphome::api::ProtoService
 

Namespaces

namespace  esphome
 Providing packet encoding functions for exchanging data with a remote host.
 
namespace  esphome::api
 

Typedefs

using esphome::api::proto_varint_value_t = uint64_t
 Type used for decoded varint values - uint64_t when BLE needs 64-bit addresses, uint32_t otherwise.
 

Functions

constexpr uint32_t esphome::api::encode_zigzag32 (int32_t value)
 
constexpr uint64_t esphome::api::encode_zigzag64 (int64_t value)
 
constexpr int32_t esphome::api::decode_zigzag32 (uint32_t value)
 
constexpr int64_t esphome::api::decode_zigzag64 (uint64_t value)
 
uint16_t esphome::api::count_packed_varints (const uint8_t *data, size_t len)
 Count number of varints in a packed buffer.
 
void esphome::api::encode_varint_to_buffer (uint32_t val, uint8_t *buffer)
 Encode a varint directly into a pre-allocated buffer.
 
template<typename T >
void esphome::api::proto_encode_msg (const void *msg, ProtoWriteBuffer &buf)
 
template<typename T >
const char * esphome::api::proto_enum_to_string (T value)
 

Variables

constexpr uint8_t esphome::api::WIRE_TYPE_VARINT = 0
 
constexpr uint8_t esphome::api::WIRE_TYPE_LENGTH_DELIMITED = 2
 
constexpr uint8_t esphome::api::WIRE_TYPE_FIXED32 = 5
 
constexpr uint8_t esphome::api::WIRE_TYPE_MASK = 0b111
 
constexpr uint32_t esphome::api::PROTO_VARINT_PARSE_FAILED = 0
 Sentinel value for consumed field indicating parse failure.