ESPHome  2022.9.1
Public Member Functions | Protected Attributes
esphome::api::ProtoWriteBuffer Class Reference

#include <proto.h>

Public Member Functions

 ProtoWriteBuffer (std::vector< uint8_t > *buffer)
 
void write (uint8_t value)
 
void encode_varint_raw (ProtoVarInt value)
 
void encode_varint_raw (uint32_t value)
 
void encode_field_raw (uint32_t field_id, uint32_t type)
 
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_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)
 
void encode_fixed32 (uint32_t field_id, uint32_t value, bool force=false)
 
void encode_fixed64 (uint32_t field_id, uint64_t value, bool force=false)
 
template<typename T >
void encode_enum (uint32_t field_id, T value, bool force=false)
 
void encode_float (uint32_t field_id, float value, bool force=false)
 
void encode_int32 (uint32_t field_id, int32_t value, bool force=false)
 
void encode_int64 (uint32_t field_id, int64_t value, bool force=false)
 
void encode_sint32 (uint32_t field_id, int32_t value, bool force=false)
 
void encode_sint64 (uint32_t field_id, int64_t value, bool force=false)
 
template<class C >
void encode_message (uint32_t field_id, const C &value, bool force=false)
 
std::vector< uint8_t > * get_buffer () const
 

Protected Attributes

std::vector< uint8_t > * buffer_
 

Detailed Description

Definition at line 144 of file proto.h.

Constructor & Destructor Documentation

◆ ProtoWriteBuffer()

esphome::api::ProtoWriteBuffer::ProtoWriteBuffer ( std::vector< uint8_t > *  buffer)
inline

Definition at line 146 of file proto.h.

Member Function Documentation

◆ encode_bool()

void esphome::api::ProtoWriteBuffer::encode_bool ( uint32_t  field_id,
bool  value,
bool  force = false 
)
inline

Definition at line 182 of file proto.h.

◆ encode_bytes()

void esphome::api::ProtoWriteBuffer::encode_bytes ( uint32_t  field_id,
const uint8_t *  data,
size_t  len,
bool  force = false 
)
inline

Definition at line 167 of file proto.h.

◆ encode_enum()

template<typename T >
void esphome::api::ProtoWriteBuffer::encode_enum ( uint32_t  field_id,
value,
bool  force = false 
)
inline

Definition at line 212 of file proto.h.

◆ encode_field_raw()

void esphome::api::ProtoWriteBuffer::encode_field_raw ( uint32_t  field_id,
uint32_t  type 
)
inline

Definition at line 150 of file proto.h.

◆ encode_fixed32()

void esphome::api::ProtoWriteBuffer::encode_fixed32 ( uint32_t  field_id,
uint32_t  value,
bool  force = false 
)
inline

Definition at line 188 of file proto.h.

◆ encode_fixed64()

void esphome::api::ProtoWriteBuffer::encode_fixed64 ( uint32_t  field_id,
uint64_t  value,
bool  force = false 
)
inline

Definition at line 198 of file proto.h.

◆ encode_float()

void esphome::api::ProtoWriteBuffer::encode_float ( uint32_t  field_id,
float  value,
bool  force = false 
)
inline

Definition at line 215 of file proto.h.

◆ encode_int32()

void esphome::api::ProtoWriteBuffer::encode_int32 ( uint32_t  field_id,
int32_t  value,
bool  force = false 
)
inline

Definition at line 226 of file proto.h.

◆ encode_int64()

void esphome::api::ProtoWriteBuffer::encode_int64 ( uint32_t  field_id,
int64_t  value,
bool  force = false 
)
inline

Definition at line 234 of file proto.h.

◆ encode_message()

template<class C >
void esphome::api::ProtoWriteBuffer::encode_message ( uint32_t  field_id,
const C &  value,
bool  force = false 
)
inline

Definition at line 255 of file proto.h.

◆ encode_sint32()

void esphome::api::ProtoWriteBuffer::encode_sint32 ( uint32_t  field_id,
int32_t  value,
bool  force = false 
)
inline

Definition at line 237 of file proto.h.

◆ encode_sint64()

void esphome::api::ProtoWriteBuffer::encode_sint64 ( uint32_t  field_id,
int64_t  value,
bool  force = false 
)
inline

Definition at line 246 of file proto.h.

◆ encode_string() [1/2]

void esphome::api::ProtoWriteBuffer::encode_string ( uint32_t  field_id,
const char *  string,
size_t  len,
bool  force = false 
)
inline

Definition at line 154 of file proto.h.

◆ encode_string() [2/2]

void esphome::api::ProtoWriteBuffer::encode_string ( uint32_t  field_id,
const std::string &  value,
bool  force = false 
)
inline

Definition at line 164 of file proto.h.

◆ encode_uint32()

void esphome::api::ProtoWriteBuffer::encode_uint32 ( uint32_t  field_id,
uint32_t  value,
bool  force = false 
)
inline

Definition at line 170 of file proto.h.

◆ encode_uint64()

void esphome::api::ProtoWriteBuffer::encode_uint64 ( uint32_t  field_id,
uint64_t  value,
bool  force = false 
)
inline

Definition at line 176 of file proto.h.

◆ encode_varint_raw() [1/2]

void esphome::api::ProtoWriteBuffer::encode_varint_raw ( ProtoVarInt  value)
inline

Definition at line 148 of file proto.h.

◆ encode_varint_raw() [2/2]

void esphome::api::ProtoWriteBuffer::encode_varint_raw ( uint32_t  value)
inline

Definition at line 149 of file proto.h.

◆ get_buffer()

std::vector<uint8_t>* esphome::api::ProtoWriteBuffer::get_buffer ( ) const
inline

Definition at line 267 of file proto.h.

◆ write()

void esphome::api::ProtoWriteBuffer::write ( uint8_t  value)
inline

Definition at line 147 of file proto.h.

Field Documentation

◆ buffer_

std::vector<uint8_t>* esphome::api::ProtoWriteBuffer::buffer_
protected

Definition at line 270 of file proto.h.


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