1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-22 11:43:51 +01:00

Implement zero-copy API for zwave_proxy (#10836)

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
J. Nick Koston
2025-09-23 15:12:54 -05:00
committed by GitHub
parent e9c2e211ef
commit 365e3afa9b
5 changed files with 15 additions and 14 deletions

View File

@@ -3035,12 +3035,9 @@ bool UpdateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
bool ZWaveProxyFrame::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 1: {
const std::string &data_str = value.as_string();
this->data_len = data_str.size();
if (this->data_len > 257) {
this->data_len = 257;
}
memcpy(this->data, data_str.data(), this->data_len);
// Use raw data directly to avoid allocation
this->data = value.data();
this->data_len = value.size();
break;
}
default: