mirror of
https://github.com/esphome/esphome.git
synced 2025-08-06 18:37:47 +00:00
Merge branch 'bluetooth_proxy_guard_var' into integration
This commit is contained in:
commit
a5d1b11204
@ -63,6 +63,12 @@ static std::vector<api::BluetoothLERawAdvertisement> &get_batch_buffer() {
|
|||||||
return batch_buffer;
|
return batch_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Global batch buffer to avoid guard variable (saves 8 bytes)
|
||||||
|
// This is initialized at program startup before any threads
|
||||||
|
static std::vector<api::BluetoothLERawAdvertisement> batch_buffer;
|
||||||
|
|
||||||
|
static std::vector<api::BluetoothLERawAdvertisement> &get_batch_buffer() { return batch_buffer; }
|
||||||
|
|
||||||
bool BluetoothProxy::parse_devices(const esp32_ble::BLEScanResult *scan_results, size_t count) {
|
bool BluetoothProxy::parse_devices(const esp32_ble::BLEScanResult *scan_results, size_t count) {
|
||||||
if (!api::global_api_server->is_connected() || this->api_connection_ == nullptr || !this->raw_advertisements_)
|
if (!api::global_api_server->is_connected() || this->api_connection_ == nullptr || !this->raw_advertisements_)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user