1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-15 14:25:45 +00:00

[esp32_ble_server] Replace EventEmitter with direct callbacks to reduce memory usage (#10946)

This commit is contained in:
J. Nick Koston
2025-10-05 15:20:40 -05:00
committed by GitHub
parent 722c5a94f2
commit 39d5cbc74a
13 changed files with 107 additions and 234 deletions

View File

@@ -74,9 +74,10 @@ void BLEDescriptor::gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_
break;
this->value_.attr_len = param->write.len;
memcpy(this->value_.attr_value, param->write.value, param->write.len);
this->emit_(BLEDescriptorEvt::VectorEvt::ON_WRITE,
std::vector<uint8_t>(param->write.value, param->write.value + param->write.len),
param->write.conn_id);
if (this->on_write_callback_) {
(*this->on_write_callback_)(std::span<const uint8_t>(param->write.value, param->write.len),
param->write.conn_id);
}
break;
}
default: