1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-18 07:45:56 +00:00

Refactor API frame helpers to enable buffer reuse (#8825)

This commit is contained in:
J. Nick Koston
2025-05-18 17:05:20 -04:00
committed by GitHub
parent 574aabdede
commit b0c1e0e28c
5 changed files with 162 additions and 46 deletions

View File

@@ -1645,7 +1645,7 @@ bool APIConnection::send_buffer(ProtoWriteBuffer buffer, uint32_t message_type)
return false;
}
APIError err = this->helper_->write_packet(message_type, buffer.get_buffer()->data(), buffer.get_buffer()->size());
APIError err = this->helper_->write_protobuf_packet(message_type, buffer);
if (err == APIError::WOULD_BLOCK)
return false;
if (err != APIError::OK) {