ESPHome 2026.8.0b4
Loading...
Searching...
No Matches
esphome::ble_device_base::RawAdvertisementCallback Struct Reference

Subscriber slot for the raw-advertisement stream (the bluetooth_proxy path). More...

#include <ble_hub.h>

Public Member Functions

bool is_set () const
 A default-constructed slot is "no subscriber"; hubs must guard on this.
 
void invoke (const RawAdvertisement &adv) const
 

Data Fields

void * instance {nullptr}
 
void(* fn )(void *instance, const RawAdvertisement &adv)
 

Detailed Description

Subscriber slot for the raw-advertisement stream (the bluetooth_proxy path).

The hub delivers on the ESPHome main loop. Same shape as logger.h's LogCallback: an instance pointer plus a plain function pointer — no virtuals, no std::function.

Usage: hub->set_raw_advertisement_callback({this, [](void *self, const RawAdvertisement &adv) { static_cast<MyComponent *>(self)->on_raw_advertisement(adv); }});

Definition at line 43 of file ble_hub.h.

Member Function Documentation

◆ invoke()

void esphome::ble_device_base::RawAdvertisementCallback::invoke ( const RawAdvertisement & adv) const
inline

Definition at line 48 of file ble_hub.h.

◆ is_set()

bool esphome::ble_device_base::RawAdvertisementCallback::is_set ( ) const
inline

A default-constructed slot is "no subscriber"; hubs must guard on this.

Definition at line 47 of file ble_hub.h.

Field Documentation

◆ fn

void(* esphome::ble_device_base::RawAdvertisementCallback::fn) (void *instance, const RawAdvertisement &adv)
inline

Definition at line 45 of file ble_hub.h.

◆ instance

void* esphome::ble_device_base::RawAdvertisementCallback::instance {nullptr}

Definition at line 44 of file ble_hub.h.


The documentation for this struct was generated from the following file: