ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::api::ProtoEncode Class Reference

Static encode helpers for the generated encode bodies. More...

#include <proto.h>

Static Public Member Functions

template<typename T >
static uint8_t * encode_varint_raw_loop (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, T value)
 Write a multi-byte varint directly through a pos pointer.
 
static uint8_t *ESPHOME_ALWAYS_INLINE encode_varint_raw (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t value)
 
static uint8_t *ESPHOME_ALWAYS_INLINE encode_varint_raw_short (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t value)
 Encode a varint that is expected to be 1-2 bytes (e.g. zigzag RSSI, small lengths).
 
static uint8_t *ESPHOME_ALWAYS_INLINE encode_varint_raw_64 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint64_t value)
 
static uint8_t *ESPHOME_ALWAYS_INLINE encode_varint_raw_48bit (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint64_t value)
 Encode a 48-bit MAC address (stored in a uint64) as varint.
 
static uint8_t *ESPHOME_ALWAYS_INLINE encode_field_raw (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t type)
 
static uint8_t *ESPHOME_ALWAYS_INLINE write_raw_byte (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint8_t b)
 Write a single precomputed tag byte. Tag must be < 128.
 
static uint8_t *ESPHOME_ALWAYS_INLINE reserve_byte (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM)
 Reserve one byte for later backpatch (e.g., sub-message length).
 
static uint8_t *ESPHOME_ALWAYS_INLINE encode_raw (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, const void *data, size_t len)
 Write raw bytes to the buffer (no tag, no length prefix).
 
static uint8_t * encode_short_string_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint8_t tag, const StringRef &ref)
 Encode tag + 1-byte length + raw string data.
 
static uint8_t * encode_short_progmem_string_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint8_t tag, const ProgmemStringRef &ref)
 encode_short_string_force for a string that may be in flash (PROGMEM).
 
static PROTO_OUTLINE_FOR_SIZE uint8_t * write_tag_and_fixed32 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint8_t tag, uint32_t value)
 Write a precomputed tag byte + 32-bit value. Outlined on embedded: one copy beats inline stores per field.
 
static uint8_t * encode_string_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const char *string, size_t len)
 
static uint8_t * encode_string (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const char *string, size_t len)
 
static uint8_t * encode_string_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const std::string &value)
 
static uint8_t * encode_string (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const StringRef &ref)
 
static uint8_t * encode_string_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const StringRef &ref)
 
static uint8_t * encode_bytes (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const uint8_t *data, size_t len)
 
static uint8_t * encode_bytes_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const uint8_t *data, size_t len)
 
static uint8_t * encode_progmem_bytes (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const uint8_t *data, size_t len)
 encode_bytes for data in flash (PROGMEM), which ESP8266 can only read with progmem_memcpy.
 
static uint8_t * encode_progmem_bytes_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const uint8_t *data, size_t len)
 
static uint8_t * encode_progmem_string (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const ProgmemStringRef &ref)
 encode_progmem_bytes for a string field that may be in flash.
 
static uint8_t * encode_progmem_string_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const ProgmemStringRef &ref)
 
static uint8_t * encode_uint32_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t value)
 
static uint8_t * encode_uint32 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t value)
 
static uint8_t * encode_uint64_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint64_t value)
 
static uint8_t * encode_uint64 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint64_t value)
 
static uint8_t * encode_bool_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, bool value)
 
static uint8_t * encode_bool (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, bool value)
 
static PROTO_OUTLINE_FOR_SIZE uint8_t * encode_fixed32_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t value)
 Tag + fixed32 for multi-byte tags; single-byte tags use write_tag_and_fixed32.
 
static uint8_t * encode_fixed32 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t value)
 
static uint8_t * encode_float (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, float value)
 
static uint8_t * encode_float_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, float value)
 
static uint8_t * encode_int32_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int32_t value)
 
static uint8_t * encode_int32 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int32_t value)
 
static uint8_t * encode_int64 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int64_t value)
 
static uint8_t * encode_int64_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int64_t value)
 
static uint8_t * encode_sint32 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int32_t value)
 
static uint8_t * encode_sint32_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int32_t value)
 
static uint8_t * encode_sint64 (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int64_t value)
 
static uint8_t * encode_sint64_force (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int64_t value)
 
template<typename T >
static uint8_t * encode_sub_message (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const T &value)
 Repeated sub-message element; the constant tag is written inline.
 
template<typename T >
static uint8_t * encode_optional_sub_message (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const T &value)
 Singular sub-message field, skipped when it encodes to nothing.
 
static uint8_t * encode_sub_message_body (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, const void *value, ProtoEncodeFn encode_fn)
 Length and body, length backpatched after the body is written.
 
static uint8_t * encode_sized_sub_message_body (uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM, uint32_t nested_size, const void *value, ProtoEncodeFn encode_fn)
 Length and body for a precomputed size.
 

Detailed Description

Static encode helpers for the generated encode bodies.

Each takes the write cursor by value and returns it advanced, so outlined calls at -Os chain through the return register instead of a stack slot. Helpers without a _force suffix skip fields holding the proto3 default.

Definition at line 309 of file proto.h.

Member Function Documentation

◆ encode_bool()

static uint8_t * esphome::api::ProtoEncode::encode_bool ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
bool value )
inlinestaticnodiscard

Definition at line 550 of file proto.h.

◆ encode_bool_force()

static uint8_t * esphome::api::ProtoEncode::encode_bool_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
bool value )
inlinestaticnodiscard

Definition at line 543 of file proto.h.

◆ encode_bytes()

static uint8_t * esphome::api::ProtoEncode::encode_bytes ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const uint8_t * data,
size_t len )
inlinestaticnodiscard

Definition at line 478 of file proto.h.

◆ encode_bytes_force()

static uint8_t * esphome::api::ProtoEncode::encode_bytes_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const uint8_t * data,
size_t len )
inlinestaticnodiscard

Definition at line 482 of file proto.h.

◆ encode_field_raw()

static uint8_t *ESPHOME_ALWAYS_INLINE esphome::api::ProtoEncode::encode_field_raw ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
uint32_t type )
inlinestaticnodiscard

Definition at line 384 of file proto.h.

◆ encode_fixed32()

static uint8_t * esphome::api::ProtoEncode::encode_fixed32 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
uint32_t value )
inlinestaticnodiscard

Definition at line 564 of file proto.h.

◆ encode_fixed32_force()

static PROTO_OUTLINE_FOR_SIZE uint8_t * esphome::api::ProtoEncode::encode_fixed32_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
uint32_t value )
inlinestaticnodiscard

Tag + fixed32 for multi-byte tags; single-byte tags use write_tag_and_fixed32.

Definition at line 557 of file proto.h.

◆ encode_float()

static uint8_t * esphome::api::ProtoEncode::encode_float ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
float value )
inlinestaticnodiscard

Definition at line 574 of file proto.h.

◆ encode_float_force()

static uint8_t * esphome::api::ProtoEncode::encode_float_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
float value )
inlinestaticnodiscard

Definition at line 578 of file proto.h.

◆ encode_int32()

static uint8_t * esphome::api::ProtoEncode::encode_int32 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
int32_t value )
inlinestaticnodiscard

Definition at line 590 of file proto.h.

◆ encode_int32_force()

static uint8_t * esphome::api::ProtoEncode::encode_int32_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
int32_t value )
inlinestaticnodiscard

Definition at line 582 of file proto.h.

◆ encode_int64()

static uint8_t * esphome::api::ProtoEncode::encode_int64 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
int64_t value )
inlinestaticnodiscard

Definition at line 596 of file proto.h.

◆ encode_int64_force()

static uint8_t * esphome::api::ProtoEncode::encode_int64_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
int64_t value )
inlinestaticnodiscard

Definition at line 600 of file proto.h.

◆ encode_optional_sub_message()

template<typename T >
static uint8_t * esphome::api::ProtoEncode::encode_optional_sub_message ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const T & value )
inlinestaticnodiscard

Singular sub-message field, skipped when it encodes to nothing.

Definition at line 629 of file proto.h.

◆ encode_progmem_bytes()

static uint8_t * esphome::api::ProtoEncode::encode_progmem_bytes ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const uint8_t * data,
size_t len )
inlinestaticnodiscard

encode_bytes for data in flash (PROGMEM), which ESP8266 can only read with progmem_memcpy.

Definition at line 487 of file proto.h.

◆ encode_progmem_bytes_force()

static uint8_t * esphome::api::ProtoEncode::encode_progmem_bytes_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const uint8_t * data,
size_t len )
inlinestaticnodiscard

Definition at line 493 of file proto.h.

◆ encode_progmem_string()

static uint8_t * esphome::api::ProtoEncode::encode_progmem_string ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const ProgmemStringRef & ref )
inlinestaticnodiscard

encode_progmem_bytes for a string field that may be in flash.

Definition at line 502 of file proto.h.

◆ encode_progmem_string_force()

static uint8_t * esphome::api::ProtoEncode::encode_progmem_string_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const ProgmemStringRef & ref )
inlinestaticnodiscard

Definition at line 512 of file proto.h.

◆ encode_raw()

static uint8_t *ESPHOME_ALWAYS_INLINE esphome::api::ProtoEncode::encode_raw ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
const void * data,
size_t len )
inlinestaticnodiscard

Write raw bytes to the buffer (no tag, no length prefix).

Definition at line 403 of file proto.h.

◆ encode_short_progmem_string_force()

static uint8_t * esphome::api::ProtoEncode::encode_short_progmem_string_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint8_t tag,
const ProgmemStringRef & ref )
inlinestaticnodiscard

encode_short_string_force for a string that may be in flash (PROGMEM).

Definition at line 427 of file proto.h.

◆ encode_short_string_force()

static uint8_t * esphome::api::ProtoEncode::encode_short_string_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint8_t tag,
const StringRef & ref )
inlinestaticnodiscard

Encode tag + 1-byte length + raw string data.

For strings with max_data_length < 128. Tag must be a single-byte varint (< 128). Always encodes (no zero check).

Definition at line 410 of file proto.h.

◆ encode_sint32()

static uint8_t * esphome::api::ProtoEncode::encode_sint32 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
int32_t value )
inlinestaticnodiscard

Definition at line 604 of file proto.h.

◆ encode_sint32_force()

static uint8_t * esphome::api::ProtoEncode::encode_sint32_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
int32_t value )
inlinestaticnodiscard

Definition at line 608 of file proto.h.

◆ encode_sint64()

static uint8_t * esphome::api::ProtoEncode::encode_sint64 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
int64_t value )
inlinestaticnodiscard

Definition at line 612 of file proto.h.

◆ encode_sint64_force()

static uint8_t * esphome::api::ProtoEncode::encode_sint64_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
int64_t value )
inlinestaticnodiscard

Definition at line 616 of file proto.h.

◆ encode_sized_sub_message_body()

uint8_t * esphome::api::ProtoEncode::encode_sized_sub_message_body ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t nested_size,
const void * value,
ProtoEncodeFn encode_fn )
staticnodiscard

Length and body for a precomputed size.

Definition at line 170 of file proto.cpp.

◆ encode_string() [1/2]

static uint8_t * esphome::api::ProtoEncode::encode_string ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const char * string,
size_t len )
inlinestaticnodiscard

Definition at line 460 of file proto.h.

◆ encode_string() [2/2]

static uint8_t * esphome::api::ProtoEncode::encode_string ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const StringRef & ref )
inlinestaticnodiscard

Definition at line 470 of file proto.h.

◆ encode_string_force() [1/3]

static uint8_t * esphome::api::ProtoEncode::encode_string_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const char * string,
size_t len )
inlinestaticnodiscard

Definition at line 446 of file proto.h.

◆ encode_string_force() [2/3]

static uint8_t * esphome::api::ProtoEncode::encode_string_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const std::string & value )
inlinestaticnodiscard

Definition at line 466 of file proto.h.

◆ encode_string_force() [3/3]

static uint8_t * esphome::api::ProtoEncode::encode_string_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const StringRef & ref )
inlinestaticnodiscard

Definition at line 474 of file proto.h.

◆ encode_sub_message()

template<typename T >
static uint8_t * esphome::api::ProtoEncode::encode_sub_message ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
const T & value )
inlinestaticnodiscard

Repeated sub-message element; the constant tag is written inline.

Definition at line 622 of file proto.h.

◆ encode_sub_message_body()

uint8_t * esphome::api::ProtoEncode::encode_sub_message_body ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
const void * value,
ProtoEncodeFn encode_fn )
staticnodiscard

Length and body, length backpatched after the body is written.

Definition at line 147 of file proto.cpp.

◆ encode_uint32()

static uint8_t * esphome::api::ProtoEncode::encode_uint32 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
uint32_t value )
inlinestaticnodiscard

Definition at line 526 of file proto.h.

◆ encode_uint32_force()

static uint8_t * esphome::api::ProtoEncode::encode_uint32_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
uint32_t value )
inlinestaticnodiscard

Definition at line 521 of file proto.h.

◆ encode_uint64()

static uint8_t * esphome::api::ProtoEncode::encode_uint64 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
uint64_t value )
inlinestaticnodiscard

Definition at line 537 of file proto.h.

◆ encode_uint64_force()

static uint8_t * esphome::api::ProtoEncode::encode_uint64_force ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t field_id,
uint64_t value )
inlinestaticnodiscard

Definition at line 532 of file proto.h.

◆ encode_varint_raw()

static uint8_t *ESPHOME_ALWAYS_INLINE esphome::api::ProtoEncode::encode_varint_raw ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t value )
inlinestaticnodiscard

Definition at line 325 of file proto.h.

◆ encode_varint_raw_48bit()

static uint8_t *ESPHOME_ALWAYS_INLINE esphome::api::ProtoEncode::encode_varint_raw_48bit ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint64_t value )
inlinestaticnodiscard

Encode a 48-bit MAC address (stored in a uint64) as varint.

Real MAC addresses occupy the full 48 bits (OUI in upper 24), so the fast path – any non-zero bit in the top 6 of 48 – emits exactly 7 bytes with no per-byte branch. Falls back to the general loop otherwise. Caller must guarantee value fits in 48 bits (checked in debug builds).

Definition at line 364 of file proto.h.

◆ encode_varint_raw_64()

static uint8_t *ESPHOME_ALWAYS_INLINE esphome::api::ProtoEncode::encode_varint_raw_64 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint64_t value )
inlinestaticnodiscard

Definition at line 350 of file proto.h.

◆ encode_varint_raw_loop()

template<typename T >
static uint8_t * esphome::api::ProtoEncode::encode_varint_raw_loop ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
T value )
inlinestaticnodiscard

Write a multi-byte varint directly through a pos pointer.

Definition at line 313 of file proto.h.

◆ encode_varint_raw_short()

static uint8_t *ESPHOME_ALWAYS_INLINE esphome::api::ProtoEncode::encode_varint_raw_short ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint32_t value )
inlinestaticnodiscard

Encode a varint that is expected to be 1-2 bytes (e.g. zigzag RSSI, small lengths).

Definition at line 335 of file proto.h.

◆ reserve_byte()

static uint8_t *ESPHOME_ALWAYS_INLINE esphome::api::ProtoEncode::reserve_byte ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM)
inlinestaticnodiscard

Reserve one byte for later backpatch (e.g., sub-message length).

Advances pos past the reserved byte without writing a value.

Definition at line 397 of file proto.h.

◆ write_raw_byte()

static uint8_t *ESPHOME_ALWAYS_INLINE esphome::api::ProtoEncode::write_raw_byte ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint8_t b )
inlinestaticnodiscard

Write a single precomputed tag byte. Tag must be < 128.

Definition at line 389 of file proto.h.

◆ write_tag_and_fixed32()

static PROTO_OUTLINE_FOR_SIZE uint8_t * esphome::api::ProtoEncode::write_tag_and_fixed32 ( uint8_t *__restrict__ pos PROTO_ENCODE_DEBUG_PARAM,
uint8_t tag,
uint32_t value )
inlinestaticnodiscard

Write a precomputed tag byte + 32-bit value. Outlined on embedded: one copy beats inline stores per field.

Definition at line 439 of file proto.h.


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