1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00
This commit is contained in:
J. Nick Koston
2025-07-20 19:40:21 -10:00
parent 1dc736e27a
commit 9cb86241b9
3 changed files with 65 additions and 15 deletions

View File

@@ -831,6 +831,8 @@ bool NoiseEncryptionSetKeyRequest::decode_length(uint32_t field_id, ProtoLengthD
switch (field_id) {
case 1:
this->key = value.as_string();
this->key_ptr_ = reinterpret_cast<const uint8_t *>(this->key.data());
this->key_len_ = this->key.size();
break;
default:
return false;
@@ -1999,6 +2001,8 @@ bool BluetoothGATTWriteRequest::decode_length(uint32_t field_id, ProtoLengthDeli
switch (field_id) {
case 4:
this->data = value.as_string();
this->data_ptr_ = reinterpret_cast<const uint8_t *>(this->data.data());
this->data_len_ = this->data.size();
break;
default:
return false;
@@ -2035,6 +2039,8 @@ bool BluetoothGATTWriteDescriptorRequest::decode_length(uint32_t field_id, Proto
switch (field_id) {
case 3:
this->data = value.as_string();
this->data_ptr_ = reinterpret_cast<const uint8_t *>(this->data.data());
this->data_len_ = this->data.size();
break;
default:
return false;
@@ -2257,6 +2263,8 @@ bool VoiceAssistantAudio::decode_length(uint32_t field_id, ProtoLengthDelimited
switch (field_id) {
case 1:
this->data = value.as_string();
this->data_ptr_ = reinterpret_cast<const uint8_t *>(this->data.data());
this->data_len_ = this->data.size();
break;
default:
return false;

View File

@@ -993,6 +993,7 @@ class NoiseEncryptionSetKeyRequest : public ProtoDecodableMessage {
#endif
const uint8_t *key_ptr_{nullptr};
size_t key_len_{0};
std::string key{}; // Storage for decoded data
void set_key(const uint8_t *data, size_t len) {
this->key_ptr_ = data;
this->key_len_ = len;
@@ -1921,6 +1922,7 @@ class BluetoothGATTWriteRequest : public ProtoDecodableMessage {
bool response{false};
const uint8_t *data_ptr_{nullptr};
size_t data_len_{0};
std::string data{}; // Storage for decoded data
void set_data(const uint8_t *data, size_t len) {
this->data_ptr_ = data;
this->data_len_ = len;
@@ -1960,6 +1962,7 @@ class BluetoothGATTWriteDescriptorRequest : public ProtoDecodableMessage {
uint32_t handle{0};
const uint8_t *data_ptr_{nullptr};
size_t data_len_{0};
std::string data{}; // Storage for decoded data
void set_data(const uint8_t *data, size_t len) {
this->data_ptr_ = data;
this->data_len_ = len;
@@ -2298,6 +2301,7 @@ class VoiceAssistantAudio : public ProtoDecodableMessage {
#endif
const uint8_t *data_ptr_{nullptr};
size_t data_len_{0};
std::string data{}; // Storage for decoded data
void set_data(const uint8_t *data, size_t len) {
this->data_ptr_ = data;
this->data_len_ = len;