#include <proto.h>
|
| | ProtoWriteBuffer (APIBuffer *buffer) |
| |
| | ProtoWriteBuffer (APIBuffer *buffer, size_t write_pos) |
| |
| void ESPHOME_ALWAYS_INLINE | encode_varint_raw (uint32_t value) |
| |
| void | encode_field_raw (uint32_t field_id, uint32_t type) |
| | Encode a field key (tag/wire type combination).
|
| |
| template<typename T > |
| void | encode_sub_message (uint32_t field_id, const T &value) |
| | Single-pass encode for repeated submessage elements.
|
| |
| template<typename T > |
| void | encode_optional_sub_message (uint32_t field_id, const T &value) |
| | Encode an optional singular submessage field — skips if empty.
|
| |
| void | encode_sub_message (uint32_t field_id, const void *value, uint8_t *(*encode_fn)(const void *, ProtoWriteBuffer &PROTO_ENCODE_DEBUG_PARAM)) |
| |
| void | encode_optional_sub_message (uint32_t field_id, uint32_t nested_size, const void *value, uint8_t *(*encode_fn)(const void *, ProtoWriteBuffer &PROTO_ENCODE_DEBUG_PARAM)) |
| |
| APIBuffer * | get_buffer () const |
| |
| uint8_t * | get_pos () const |
| |
| void | set_pos (uint8_t *pos) |
| |
Definition at line 231 of file proto.h.
◆ ProtoWriteBuffer() [1/2]
| esphome::api::ProtoWriteBuffer::ProtoWriteBuffer |
( |
APIBuffer * | buffer | ) |
|
|
inline |
◆ ProtoWriteBuffer() [2/2]
| esphome::api::ProtoWriteBuffer::ProtoWriteBuffer |
( |
APIBuffer * | buffer, |
|
|
size_t | write_pos ) |
|
inline |
◆ debug_check_bounds_() [1/2]
| void esphome::api::ProtoWriteBuffer::debug_check_bounds_ |
( |
size_t | bytes | ) |
|
|
inlineprotected |
◆ debug_check_bounds_() [2/2]
| void esphome::api::ProtoWriteBuffer::debug_check_bounds_ |
( |
size_t | bytes, |
|
|
const char * | caller = __builtin_FUNCTION() ) |
|
protected |
◆ debug_check_encode_size_()
| void esphome::api::ProtoWriteBuffer::debug_check_encode_size_ |
( |
uint32_t | field_id, |
|
|
uint32_t | expected, |
|
|
ptrdiff_t | actual ) |
|
protected |
◆ encode_field_raw()
| void esphome::api::ProtoWriteBuffer::encode_field_raw |
( |
uint32_t | field_id, |
|
|
uint32_t | type ) |
|
inline |
Encode a field key (tag/wire type combination).
- Parameters
-
| field_id | Field number (tag) in the protobuf message |
| type | Wire type value:
- 0: Varint (int32, int64, uint32, uint64, sint32, sint64, bool, enum)
- 2: Length-delimited (string, bytes, embedded messages, packed repeated fields)
- 5: 32-bit (fixed32, sfixed32, float)
- Note: Wire type 1 (64-bit fixed) is not supported
|
Following https://protobuf.dev/programming-guides/encoding/#structure
Definition at line 255 of file proto.h.
◆ encode_optional_sub_message() [1/2]
template<typename T >
| void esphome::api::ProtoWriteBuffer::encode_optional_sub_message |
( |
uint32_t | field_id, |
|
|
const T & | value ) |
|
inline |
Encode an optional singular submessage field — skips if empty.
Thin template wrapper; all buffer work is in the non-template core.
Definition at line 860 of file proto.h.
◆ encode_optional_sub_message() [2/2]
| void esphome::api::ProtoWriteBuffer::encode_optional_sub_message |
( |
uint32_t | field_id, |
|
|
uint32_t | nested_size, |
|
|
const void * | value, |
|
|
uint8_t *(* | encode_fn )(const void *, ProtoWriteBuffer &PROTO_ENCODE_DEBUG_PARAM) ) |
◆ encode_sub_message() [1/2]
template<typename T >
| void esphome::api::ProtoWriteBuffer::encode_sub_message |
( |
uint32_t | field_id, |
|
|
const T & | value ) |
|
inline |
Single-pass encode for repeated submessage elements.
Thin template wrapper; all buffer work is in the non-template core.
Definition at line 855 of file proto.h.
◆ encode_sub_message() [2/2]
| void esphome::api::ProtoWriteBuffer::encode_sub_message |
( |
uint32_t | field_id, |
|
|
const void * | value, |
|
|
uint8_t *(* | encode_fn )(const void *, ProtoWriteBuffer &PROTO_ENCODE_DEBUG_PARAM) ) |
◆ encode_varint_raw()
| void ESPHOME_ALWAYS_INLINE esphome::api::ProtoWriteBuffer::encode_varint_raw |
( |
uint32_t | value | ) |
|
|
inline |
◆ encode_varint_raw_slow_()
| void esphome::api::ProtoWriteBuffer::encode_varint_raw_slow_ |
( |
uint32_t | value | ) |
|
|
protected |
◆ get_buffer()
| APIBuffer * esphome::api::ProtoWriteBuffer::get_buffer |
( |
| ) |
const |
|
inline |
◆ get_pos()
| uint8_t * esphome::api::ProtoWriteBuffer::get_pos |
( |
| ) |
const |
|
inline |
◆ set_pos()
| void esphome::api::ProtoWriteBuffer::set_pos |
( |
uint8_t * | pos | ) |
|
|
inline |
◆ buffer_
| APIBuffer* esphome::api::ProtoWriteBuffer::buffer_ |
|
protected |
◆ pos_
| uint8_t* esphome::api::ProtoWriteBuffer::pos_ |
|
protected |
The documentation for this class was generated from the following files: