1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-26 20:53:50 +00:00

[bluetooth_proxy] Replace dynamic vector with fixed array for BLE advertisements (#10174)

This commit is contained in:
J. Nick Koston
2025-08-11 15:47:46 -05:00
committed by GitHub
parent 9aa21956c8
commit 42aee53dde
10 changed files with 124 additions and 70 deletions

View File

@@ -150,7 +150,6 @@ class BluetoothProxy : public esp32_ble_tracker::ESPBTDeviceListener, public Com
std::array<BluetoothConnection *, BLUETOOTH_PROXY_MAX_CONNECTIONS> connections_{};
// BLE advertisement batching
std::vector<api::BluetoothLERawAdvertisement> advertisement_pool_;
api::BluetoothLERawAdvertisementsResponse response_;
// Group 3: 4-byte types
@@ -161,9 +160,8 @@ class BluetoothProxy : public esp32_ble_tracker::ESPBTDeviceListener, public Com
// Group 4: 1-byte types grouped together
bool active_;
uint8_t advertisement_count_{0};
uint8_t connection_count_{0};
// 3 bytes used, 1 byte padding
// 2 bytes used, 2 bytes padding
};
extern BluetoothProxy *global_bluetooth_proxy; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)