1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-10 07:12:21 +01:00

Eliminate heap allocations in bluetooth_proxy connection state reporting

This commit is contained in:
J. Nick Koston
2025-08-01 09:50:11 -10:00
parent 20ad1ab4eb
commit aa0b80b004
12 changed files with 121 additions and 39 deletions

View File

@@ -1105,10 +1105,8 @@ void APIConnection::bluetooth_gatt_notify(const BluetoothGATTNotifyRequest &msg)
bool APIConnection::send_subscribe_bluetooth_connections_free_response(
const SubscribeBluetoothConnectionsFreeRequest &msg) {
BluetoothConnectionsFreeResponse resp;
resp.free = bluetooth_proxy::global_bluetooth_proxy->get_bluetooth_connections_free();
resp.limit = bluetooth_proxy::global_bluetooth_proxy->get_bluetooth_connections_limit();
return this->send_message(resp, BluetoothConnectionsFreeResponse::MESSAGE_TYPE);
bluetooth_proxy::global_bluetooth_proxy->send_connections_free();
return true;
}
void APIConnection::bluetooth_scanner_set_mode(const BluetoothScannerSetModeRequest &msg) {