1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-27 07:32:22 +01:00

[api] Implement zero-copy API for bluetooth_proxy writes (#10840)

This commit is contained in:
J. Nick Koston
2025-09-23 13:48:57 -05:00
committed by GitHub
parent a7ee7b962e
commit 2f8a4d0caa
10 changed files with 151 additions and 27 deletions

View File

@@ -182,6 +182,10 @@ class ProtoLengthDelimited {
explicit ProtoLengthDelimited(const uint8_t *value, size_t length) : value_(value), length_(length) {}
std::string as_string() const { return std::string(reinterpret_cast<const char *>(this->value_), this->length_); }
// Direct access to raw data without string allocation
const uint8_t *data() const { return this->value_; }
size_t size() const { return this->length_; }
/**
* Decode the length-delimited data into an existing ProtoDecodableMessage instance.
*