mirror of
https://github.com/esphome/esphome.git
synced 2025-07-31 07:36:35 +00:00
Make ProtoSize an object
This commit is contained in:
parent
d111b84ca4
commit
1032e5c220
@ -53,9 +53,7 @@ bool ConnectRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void ConnectResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->invalid_password); }
|
void ConnectResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->invalid_password); }
|
||||||
}
|
|
||||||
void ConnectResponse::calculate_size(ProtoSize &size) const { size.add_bool_field(1, this->invalid_password); }
|
void ConnectResponse::calculate_size(ProtoSize &size) const { size.add_bool_field(1, this->invalid_password); }
|
||||||
}
|
|
||||||
#ifdef USE_AREAS
|
#ifdef USE_AREAS
|
||||||
void AreaInfo::encode(ProtoWriteBuffer buffer) const {
|
void AreaInfo::encode(ProtoWriteBuffer buffer) const {
|
||||||
buffer.encode_uint32(1, this->area_id);
|
buffer.encode_uint32(1, this->area_id);
|
||||||
@ -839,9 +837,7 @@ bool NoiseEncryptionSetKeyRequest::decode_length(uint32_t field_id, ProtoLengthD
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void NoiseEncryptionSetKeyResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
|
void NoiseEncryptionSetKeyResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
|
||||||
}
|
|
||||||
void NoiseEncryptionSetKeyResponse::calculate_size(ProtoSize &size) const { size.add_bool_field(1, this->success); }
|
void NoiseEncryptionSetKeyResponse::calculate_size(ProtoSize &size) const { size.add_bool_field(1, this->success); }
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
void HomeassistantServiceMap::encode(ProtoWriteBuffer buffer) const {
|
void HomeassistantServiceMap::encode(ProtoWriteBuffer buffer) const {
|
||||||
buffer.encode_string(1, this->key_ref_);
|
buffer.encode_string(1, this->key_ref_);
|
||||||
@ -910,9 +906,7 @@ bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void GetTimeResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->epoch_seconds); }
|
void GetTimeResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->epoch_seconds); }
|
||||||
}
|
|
||||||
void GetTimeResponse::calculate_size(ProtoSize &size) const { size.add_fixed32_field(1, this->epoch_seconds); }
|
void GetTimeResponse::calculate_size(ProtoSize &size) const { size.add_fixed32_field(1, this->epoch_seconds); }
|
||||||
}
|
|
||||||
#ifdef USE_API_SERVICES
|
#ifdef USE_API_SERVICES
|
||||||
void ListEntitiesServicesArgument::encode(ProtoWriteBuffer buffer) const {
|
void ListEntitiesServicesArgument::encode(ProtoWriteBuffer buffer) const {
|
||||||
buffer.encode_string(1, this->name_ref_);
|
buffer.encode_string(1, this->name_ref_);
|
||||||
@ -2317,9 +2311,7 @@ bool VoiceAssistantAnnounceRequest::decode_length(uint32_t field_id, ProtoLength
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void VoiceAssistantAnnounceFinished::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
|
void VoiceAssistantAnnounceFinished::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
|
||||||
}
|
|
||||||
void VoiceAssistantAnnounceFinished::calculate_size(ProtoSize &size) const { size.add_bool_field(1, this->success); }
|
void VoiceAssistantAnnounceFinished::calculate_size(ProtoSize &size) const { size.add_bool_field(1, this->success); }
|
||||||
}
|
|
||||||
void VoiceAssistantWakeWord::encode(ProtoWriteBuffer buffer) const {
|
void VoiceAssistantWakeWord::encode(ProtoWriteBuffer buffer) const {
|
||||||
buffer.encode_string(1, this->id_ref_);
|
buffer.encode_string(1, this->id_ref_);
|
||||||
buffer.encode_string(2, this->wake_word_ref_);
|
buffer.encode_string(2, this->wake_word_ref_);
|
||||||
|
@ -334,6 +334,9 @@ class ProtoWriteBuffer {
|
|||||||
std::vector<uint8_t> *buffer_;
|
std::vector<uint8_t> *buffer_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Forward declaration
|
||||||
|
class ProtoSize;
|
||||||
|
|
||||||
class ProtoMessage {
|
class ProtoMessage {
|
||||||
public:
|
public:
|
||||||
virtual ~ProtoMessage() = default;
|
virtual ~ProtoMessage() = default;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user