ESPHome  2024.2.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
esphome::bluetooth_proxy::BluetoothProxy Class Reference

#include <bluetooth_proxy.h>

Inheritance diagram for esphome::bluetooth_proxy::BluetoothProxy:
esphome::esp32_ble_tracker::ESPBTDeviceListener esphome::Component

Public Member Functions

 BluetoothProxy ()
 
bool parse_device (const esp32_ble_tracker::ESPBTDevice &device) override
 
bool parse_devices (esp_ble_gap_cb_param_t::ble_scan_result_evt_param *advertisements, size_t count) override
 
void dump_config () override
 
void loop () override
 
esp32_ble_tracker::AdvertisementParserType get_advertisement_parser_type () override
 
void register_connection (BluetoothConnection *connection)
 
void bluetooth_device_request (const api::BluetoothDeviceRequest &msg)
 
void bluetooth_gatt_read (const api::BluetoothGATTReadRequest &msg)
 
void bluetooth_gatt_write (const api::BluetoothGATTWriteRequest &msg)
 
void bluetooth_gatt_read_descriptor (const api::BluetoothGATTReadDescriptorRequest &msg)
 
void bluetooth_gatt_write_descriptor (const api::BluetoothGATTWriteDescriptorRequest &msg)
 
void bluetooth_gatt_send_services (const api::BluetoothGATTGetServicesRequest &msg)
 
void bluetooth_gatt_notify (const api::BluetoothGATTNotifyRequest &msg)
 
int get_bluetooth_connections_free ()
 
int get_bluetooth_connections_limit ()
 
void subscribe_api_connection (api::APIConnection *api_connection, uint32_t flags)
 
void unsubscribe_api_connection (api::APIConnection *api_connection)
 
api::APIConnectionget_api_connection ()
 
void send_device_connection (uint64_t address, bool connected, uint16_t mtu=0, esp_err_t error=ESP_OK)
 
void send_connections_free ()
 
void send_gatt_services_done (uint64_t address)
 
void send_gatt_error (uint64_t address, uint16_t handle, esp_err_t error)
 
void send_device_pairing (uint64_t address, bool paired, esp_err_t error=ESP_OK)
 
void send_device_unpairing (uint64_t address, bool success, esp_err_t error=ESP_OK)
 
void send_device_clear_cache (uint64_t address, bool success, esp_err_t error=ESP_OK)
 
void set_active (bool active)
 
bool has_active ()
 
uint32_t get_legacy_version () const
 
uint32_t get_feature_flags () const
 
- Public Member Functions inherited from esphome::esp32_ble_tracker::ESPBTDeviceListener
virtual void on_scan_end ()
 
void set_parent (ESP32BLETracker *parent)
 
- Public Member Functions inherited from esphome::Component
virtual void setup ()
 Where the component's initialization should happen. More...
 
virtual float get_setup_priority () const
 priority of setup(). More...
 
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop(). More...
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
uint32_t get_component_state () const
 
virtual void mark_failed ()
 Mark this component as failed. More...
 
bool is_failed ()
 
bool is_ready ()
 
virtual bool can_proceed ()
 
bool status_has_warning ()
 
bool status_has_error ()
 
void status_set_warning ()
 
void status_set_error ()
 
void status_clear_warning ()
 
void status_clear_error ()
 
void status_momentary_warning (const std::string &name, uint32_t length=5000)
 
void status_momentary_error (const std::string &name, uint32_t length=5000)
 
bool has_overridden_loop () const
 
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages. More...
 
const char * get_component_source () const
 Get the integration where this component was declared as a string. More...
 

Static Public Member Functions

static void uint64_to_bd_addr (uint64_t address, esp_bd_addr_t bd_addr)
 

Protected Member Functions

void send_api_packet_ (const esp32_ble_tracker::ESPBTDevice &device)
 
BluetoothConnectionget_connection_ (uint64_t address, bool reserve)
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_setup ()
 
virtual void call_dump_config ()
 
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name. More...
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
 
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name. More...
 
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 
bool cancel_retry (const std::string &name)
 Cancel a retry function. More...
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...
 

Protected Attributes

bool active_
 
std::vector< BluetoothConnection * > connections_ {}
 
api::APIConnectionapi_connection_ {nullptr}
 
bool raw_advertisements_ {false}
 
- Protected Attributes inherited from esphome::esp32_ble_tracker::ESPBTDeviceListener
ESP32BLETrackerparent_ {nullptr}
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
 
float setup_priority_override_ {NAN}
 
const char * component_source_ {nullptr}
 

Detailed Description

Definition at line 47 of file bluetooth_proxy.h.

Constructor & Destructor Documentation

◆ BluetoothProxy()

esphome::bluetooth_proxy::BluetoothProxy::BluetoothProxy ( )

Definition at line 26 of file bluetooth_proxy.cpp.

Member Function Documentation

◆ bluetooth_device_request()

void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_device_request ( const api::BluetoothDeviceRequest msg)

Definition at line 232 of file bluetooth_proxy.cpp.

◆ bluetooth_gatt_notify()

void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_notify ( const api::BluetoothGATTNotifyRequest msg)

Definition at line 423 of file bluetooth_proxy.cpp.

◆ bluetooth_gatt_read()

void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_read ( const api::BluetoothGATTReadRequest msg)

Definition at line 350 of file bluetooth_proxy.cpp.

◆ bluetooth_gatt_read_descriptor()

void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_read_descriptor ( const api::BluetoothGATTReadDescriptorRequest msg)

Definition at line 378 of file bluetooth_proxy.cpp.

◆ bluetooth_gatt_send_services()

void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_send_services ( const api::BluetoothGATTGetServicesRequest msg)

Definition at line 406 of file bluetooth_proxy.cpp.

◆ bluetooth_gatt_write()

void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_write ( const api::BluetoothGATTWriteRequest msg)

Definition at line 364 of file bluetooth_proxy.cpp.

◆ bluetooth_gatt_write_descriptor()

void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_write_descriptor ( const api::BluetoothGATTWriteDescriptorRequest msg)

Definition at line 392 of file bluetooth_proxy.cpp.

◆ dump_config()

void esphome::bluetooth_proxy::BluetoothProxy::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 87 of file bluetooth_proxy.cpp.

◆ get_advertisement_parser_type()

esp32_ble_tracker::AdvertisementParserType esphome::bluetooth_proxy::BluetoothProxy::get_advertisement_parser_type ( )
overridevirtual

Reimplemented from esphome::esp32_ble_tracker::ESPBTDeviceListener.

Definition at line 201 of file bluetooth_proxy.cpp.

◆ get_api_connection()

api::APIConnection* esphome::bluetooth_proxy::BluetoothProxy::get_api_connection ( )
inline

Definition at line 74 of file bluetooth_proxy.h.

◆ get_bluetooth_connections_free()

int esphome::bluetooth_proxy::BluetoothProxy::get_bluetooth_connections_free ( )

Definition at line 92 of file bluetooth_proxy.cpp.

◆ get_bluetooth_connections_limit()

int esphome::bluetooth_proxy::BluetoothProxy::get_bluetooth_connections_limit ( )
inline

Definition at line 70 of file bluetooth_proxy.h.

◆ get_connection_()

BluetoothConnection * esphome::bluetooth_proxy::BluetoothProxy::get_connection_ ( uint64_t  address,
bool  reserve 
)
protected

Definition at line 207 of file bluetooth_proxy.cpp.

◆ get_feature_flags()

uint32_t esphome::bluetooth_proxy::BluetoothProxy::get_feature_flags ( ) const
inline

Definition at line 103 of file bluetooth_proxy.h.

◆ get_legacy_version()

uint32_t esphome::bluetooth_proxy::BluetoothProxy::get_legacy_version ( ) const
inline

Definition at line 96 of file bluetooth_proxy.h.

◆ has_active()

bool esphome::bluetooth_proxy::BluetoothProxy::has_active ( )
inline

Definition at line 94 of file bluetooth_proxy.h.

◆ loop()

void esphome::bluetooth_proxy::BluetoothProxy::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 106 of file bluetooth_proxy.cpp.

◆ parse_device()

bool esphome::bluetooth_proxy::BluetoothProxy::parse_device ( const esp32_ble_tracker::ESPBTDevice device)
overridevirtual

◆ parse_devices()

bool esphome::bluetooth_proxy::BluetoothProxy::parse_devices ( esp_ble_gap_cb_param_t::ble_scan_result_evt_param *  advertisements,
size_t  count 
)
overridevirtual

Reimplemented from esphome::esp32_ble_tracker::ESPBTDeviceListener.

Definition at line 38 of file bluetooth_proxy.cpp.

◆ register_connection()

void esphome::bluetooth_proxy::BluetoothProxy::register_connection ( BluetoothConnection connection)
inline

Definition at line 56 of file bluetooth_proxy.h.

◆ send_api_packet_()

void esphome::bluetooth_proxy::BluetoothProxy::send_api_packet_ ( const esp32_ble_tracker::ESPBTDevice device)
protected

Definition at line 62 of file bluetooth_proxy.cpp.

◆ send_connections_free()

void esphome::bluetooth_proxy::BluetoothProxy::send_connections_free ( )

Definition at line 467 of file bluetooth_proxy.cpp.

◆ send_device_clear_cache()

void esphome::bluetooth_proxy::BluetoothProxy::send_device_clear_cache ( uint64_t  address,
bool  success,
esp_err_t  error = ESP_OK 
)

◆ send_device_connection()

void esphome::bluetooth_proxy::BluetoothProxy::send_device_connection ( uint64_t  address,
bool  connected,
uint16_t  mtu = 0,
esp_err_t  error = ESP_OK 
)

Definition at line 457 of file bluetooth_proxy.cpp.

◆ send_device_pairing()

void esphome::bluetooth_proxy::BluetoothProxy::send_device_pairing ( uint64_t  address,
bool  paired,
esp_err_t  error = ESP_OK 
)

Definition at line 494 of file bluetooth_proxy.cpp.

◆ send_device_unpairing()

void esphome::bluetooth_proxy::BluetoothProxy::send_device_unpairing ( uint64_t  address,
bool  success,
esp_err_t  error = ESP_OK 
)

Definition at line 503 of file bluetooth_proxy.cpp.

◆ send_gatt_error()

void esphome::bluetooth_proxy::BluetoothProxy::send_gatt_error ( uint64_t  address,
uint16_t  handle,
esp_err_t  error 
)

Definition at line 484 of file bluetooth_proxy.cpp.

◆ send_gatt_services_done()

void esphome::bluetooth_proxy::BluetoothProxy::send_gatt_services_done ( uint64_t  address)

Definition at line 476 of file bluetooth_proxy.cpp.

◆ set_active()

void esphome::bluetooth_proxy::BluetoothProxy::set_active ( bool  active)
inline

Definition at line 93 of file bluetooth_proxy.h.

◆ subscribe_api_connection()

void esphome::bluetooth_proxy::BluetoothProxy::subscribe_api_connection ( api::APIConnection api_connection,
uint32_t  flags 
)

Definition at line 437 of file bluetooth_proxy.cpp.

◆ uint64_to_bd_addr()

static void esphome::bluetooth_proxy::BluetoothProxy::uint64_to_bd_addr ( uint64_t  address,
esp_bd_addr_t  bd_addr 
)
inlinestatic

Definition at line 84 of file bluetooth_proxy.h.

◆ unsubscribe_api_connection()

void esphome::bluetooth_proxy::BluetoothProxy::unsubscribe_api_connection ( api::APIConnection api_connection)

Definition at line 447 of file bluetooth_proxy.cpp.

Field Documentation

◆ active_

bool esphome::bluetooth_proxy::BluetoothProxy::active_
protected

Definition at line 122 of file bluetooth_proxy.h.

◆ api_connection_

api::APIConnection* esphome::bluetooth_proxy::BluetoothProxy::api_connection_ {nullptr}
protected

Definition at line 125 of file bluetooth_proxy.h.

◆ connections_

std::vector<BluetoothConnection *> esphome::bluetooth_proxy::BluetoothProxy::connections_ {}
protected

Definition at line 124 of file bluetooth_proxy.h.

◆ raw_advertisements_

bool esphome::bluetooth_proxy::BluetoothProxy::raw_advertisements_ {false}
protected

Definition at line 126 of file bluetooth_proxy.h.


The documentation for this class was generated from the following files: