1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-14 07:43:48 +01:00

[esp32_ble_server] Optimize manufacturer_data storage to reduce memory overhead

This commit is contained in:
J. Nick Koston
2025-10-05 17:00:32 -05:00
parent 795865e139
commit 6b87187c66
6 changed files with 27 additions and 9 deletions

View File

@@ -59,6 +59,10 @@ void BLEAdvertising::set_service_data(const std::vector<uint8_t> &data) {
}
void BLEAdvertising::set_manufacturer_data(const std::vector<uint8_t> &data) {
this->set_manufacturer_data(std::span<const uint8_t>(data));
}
void BLEAdvertising::set_manufacturer_data(std::span<const uint8_t> data) {
delete[] this->advertising_data_.p_manufacturer_data;
this->advertising_data_.p_manufacturer_data = nullptr;
this->advertising_data_.manufacturer_len = data.size();