|
ESPHome 2026.11.0-dev
|
Predicate slot letting an external component drop advertisements before they are queued for the API. More...
#include <bluetooth_proxy.h>
Public Member Functions | |
| bool | is_set () const |
| A default-constructed slot is "no filter"; the proxy guards on this. | |
| bool | should_forward (const ble_device_base::RawAdvertisement &adv) const |
Data Fields | |
| void * | instance {nullptr} |
| bool(* | fn )(void *instance, const ble_device_base::RawAdvertisement &adv) |
Predicate slot letting an external component drop advertisements before they are queued for the API.
Same shape as ble_device_base::RawAdvertisementCallback. Runs on the advertisement hot path, so it must be cheap and must not block.
Usage: proxy->set_advertisement_filter({this, [](void *self, const ble_device_base::RawAdvertisement &adv) { return static_cast<MyFilter *>(self)->should_forward(adv); }});
Returning false drops the advertisement. Not called at all while the API is disconnected, which matters to a stateful filter. Compiled in only when an external component calls bluetooth_proxy.enable_advertisement_filter().
Definition at line 114 of file bluetooth_proxy.h.
|
inline |
A default-constructed slot is "no filter"; the proxy guards on this.
Definition at line 118 of file bluetooth_proxy.h.
|
inline |
Definition at line 119 of file bluetooth_proxy.h.
|
inline |
Definition at line 116 of file bluetooth_proxy.h.
| void* esphome::bluetooth_proxy::AdvertisementFilter::instance {nullptr} |
Definition at line 115 of file bluetooth_proxy.h.