#include <proto.h>
|
| | ProtoWriteBuffer (std::vector< uint8_t > *buffer) |
| |
| | ProtoWriteBuffer (std::vector< uint8_t > *buffer, size_t write_pos) |
| |
| void | encode_varint_raw (uint32_t value) |
| |
| void | encode_varint_raw_64 (uint64_t value) |
| |
| void | encode_field_raw (uint32_t field_id, uint32_t type) |
| | Encode a field key (tag/wire type combination).
|
| |
| void | encode_string (uint32_t field_id, const char *string, size_t len, bool force=false) |
| |
| void | encode_string (uint32_t field_id, const std::string &value, bool force=false) |
| |
| void | encode_string (uint32_t field_id, const StringRef &ref, bool force=false) |
| |
| void | encode_bytes (uint32_t field_id, const uint8_t *data, size_t len, bool force=false) |
| |
| void | encode_uint32 (uint32_t field_id, uint32_t value, bool force=false) |
| |
| void | encode_uint64 (uint32_t field_id, uint64_t value, bool force=false) |
| |
| void | encode_bool (uint32_t field_id, bool value, bool force=false) |
| |
| | __attribute__ ((noinline)) void encode_fixed32(uint32_t field_id |
| |
| void | encode_message (uint32_t field_id, const ProtoMessage &value, bool force=true) |
| | Encode a nested message field (force=true for repeated, false for singular)
|
| |
| std::vector< uint8_t > * | get_buffer () const |
| |
Definition at line 238 of file proto.h.
◆ ProtoWriteBuffer() [1/2]
| esphome::api::ProtoWriteBuffer::ProtoWriteBuffer |
( |
std::vector< uint8_t > * | buffer | ) |
|
|
inline |
◆ ProtoWriteBuffer() [2/2]
| esphome::api::ProtoWriteBuffer::ProtoWriteBuffer |
( |
std::vector< uint8_t > * | buffer, |
|
|
size_t | write_pos ) |
|
inline |
◆ __attribute__()
| esphome::api::ProtoWriteBuffer::__attribute__ |
( |
(noinline) | | ) |
|
◆ 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_bool()
| void esphome::api::ProtoWriteBuffer::encode_bool |
( |
uint32_t | field_id, |
|
|
bool | value, |
|
|
bool | force = false ) |
|
inline |
◆ encode_bytes()
| void esphome::api::ProtoWriteBuffer::encode_bytes |
( |
uint32_t | field_id, |
|
|
const uint8_t * | data, |
|
|
size_t | len, |
|
|
bool | force = false ) |
|
inline |
◆ 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 273 of file proto.h.
◆ encode_message()
| void esphome::api::ProtoWriteBuffer::encode_message |
( |
uint32_t | field_id, |
|
|
const ProtoMessage & | value, |
|
|
bool | force = true ) |
|
inline |
Encode a nested message field (force=true for repeated, false for singular)
Definition at line 953 of file proto.h.
◆ encode_string() [1/3]
| void esphome::api::ProtoWriteBuffer::encode_string |
( |
uint32_t | field_id, |
|
|
const char * | string, |
|
|
size_t | len, |
|
|
bool | force = false ) |
|
inline |
◆ encode_string() [2/3]
| void esphome::api::ProtoWriteBuffer::encode_string |
( |
uint32_t | field_id, |
|
|
const std::string & | value, |
|
|
bool | force = false ) |
|
inline |
◆ encode_string() [3/3]
| void esphome::api::ProtoWriteBuffer::encode_string |
( |
uint32_t | field_id, |
|
|
const StringRef & | ref, |
|
|
bool | force = false ) |
|
inline |
◆ encode_uint32()
| void esphome::api::ProtoWriteBuffer::encode_uint32 |
( |
uint32_t | field_id, |
|
|
uint32_t | value, |
|
|
bool | force = false ) |
|
inline |
◆ encode_uint64()
| void esphome::api::ProtoWriteBuffer::encode_uint64 |
( |
uint32_t | field_id, |
|
|
uint64_t | value, |
|
|
bool | force = false ) |
|
inline |
◆ encode_varint_raw()
| void esphome::api::ProtoWriteBuffer::encode_varint_raw |
( |
uint32_t | value | ) |
|
|
inline |
◆ encode_varint_raw_64()
| void esphome::api::ProtoWriteBuffer::encode_varint_raw_64 |
( |
uint64_t | value | ) |
|
|
inline |
◆ get_buffer()
| std::vector< uint8_t > * esphome::api::ProtoWriteBuffer::get_buffer |
( |
| ) |
const |
|
inline |
◆ buffer_
| std::vector<uint8_t>* esphome::api::ProtoWriteBuffer::buffer_ |
|
protected |
◆ force
| uint32_t bool esphome::api::ProtoWriteBuffer::force |
◆ pos_
| uint8_t* esphome::api::ProtoWriteBuffer::pos_ |
|
protected |
◆ value
| uint32_t esphome::api::ProtoWriteBuffer::value |
The documentation for this class was generated from the following files: