#include <proto.h>
Definition at line 745 of file proto.h.
◆ DecodeFieldFn
Stores one decoded field into msg; generated per message type.
scalar is the varint or fixed32 value, or the length of the length-delimited payload at data. An unknown field or wrong wire type matches no case and is skipped.
Definition at line 750 of file proto.h.
◆ count_repeated_field()
| uint32_t esphome::api::ProtoDecodableMessage::count_repeated_field |
( |
const uint8_t * | buffer, |
|
|
size_t | length, |
|
|
uint32_t | target_field_id ) |
|
static |
Count occurrences of a repeated field in a protobuf buffer.
This is a lightweight scan that only parses tags and skips field data.
- Parameters
-
| buffer | Pointer to the protobuf buffer |
| length | Length of the buffer in bytes |
| target_field_id | The field ID to count |
- Returns
- Number of times the field appears in the buffer
Definition at line 60 of file proto.cpp.
◆ decode_fields()
| void esphome::api::ProtoDecodableMessage::decode_fields |
( |
void * | msg, |
|
|
const uint8_t * | buffer, |
|
|
size_t | length, |
|
|
DecodeFieldFn | field ) |
|
static |
Walk buffer and hand every field to field.
The generated decode() passes the message's own decode_field, so decodable messages carry no vtable.
Definition at line 205 of file proto.cpp.
The documentation for this class was generated from the following files: