ESPHome 2025.5.0
|
#include <bluetooth_proxy.h>
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 | setup () override |
void | loop () override |
void | flush_pending_advertisements () |
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::APIConnection * | get_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 | bluetooth_scanner_set_mode (bool active) |
void | set_active (bool active) |
bool | has_active () |
uint32_t | get_legacy_version () const |
uint32_t | get_feature_flags () const |
std::string | get_bluetooth_mac_address_pretty () |
![]() | |
virtual void | on_scan_end () |
void | set_parent (ESP32BLETracker *parent) |
![]() | |
virtual float | get_setup_priority () const |
priority of setup(). | |
float | get_actual_setup_priority () const |
void | set_setup_priority (float priority) |
virtual float | get_loop_priority () const |
priority of loop(). | |
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. | |
void | mark_failed (const char *message) |
bool | is_failed () const |
bool | is_ready () const |
virtual bool | can_proceed () |
bool | status_has_warning () const |
bool | status_has_error () const |
void | status_set_warning (const char *message="unspecified") |
void | status_set_error (const char *message="unspecified") |
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. | |
const char * | get_component_source () const |
Get the integration where this component was declared as a string. | |
bool | should_warn_of_blocking (uint32_t blocking_time) |
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) |
void | send_bluetooth_scanner_state_ (esp32_ble_tracker::ScannerState state) |
BluetoothConnection * | get_connection_ (uint64_t address, bool reserve) |
![]() | |
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. | |
void | set_interval (uint32_t interval, std::function< void()> &&f) |
bool | cancel_interval (const std::string &name) |
Cancel an interval function. | |
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. | |
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. | |
void | set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f) |
Set a timeout function with a unique name. | |
void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
bool | cancel_timeout (const std::string &name) |
Cancel a timeout function. | |
void | defer (const std::string &name, std::function< void()> &&f) |
Defer a callback to the next loop() call. | |
void | defer (std::function< void()> &&f) |
Defer a callback to the next loop() call. | |
bool | cancel_defer (const std::string &name) |
Cancel a defer callback using the specified name, name must not be empty. | |
Protected Attributes | |
bool | active_ |
std::vector< BluetoothConnection * > | connections_ {} |
api::APIConnection * | api_connection_ {nullptr} |
bool | raw_advertisements_ {false} |
![]() | |
ESP32BLETracker * | parent_ {nullptr} |
![]() | |
uint32_t | component_state_ {0x0000} |
State of this component. | |
float | setup_priority_override_ {NAN} |
const char * | component_source_ {nullptr} |
uint32_t | warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_MS} |
std::string | error_message_ {} |
Definition at line 51 of file bluetooth_proxy.h.
esphome::bluetooth_proxy::BluetoothProxy::BluetoothProxy | ( | ) |
Definition at line 27 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_device_request | ( | const api::BluetoothDeviceRequest & | msg | ) |
Definition at line 339 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_notify | ( | const api::BluetoothGATTNotifyRequest & | msg | ) |
Definition at line 536 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_read | ( | const api::BluetoothGATTReadRequest & | msg | ) |
Definition at line 463 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_read_descriptor | ( | const api::BluetoothGATTReadDescriptorRequest & | msg | ) |
Definition at line 491 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_send_services | ( | const api::BluetoothGATTGetServicesRequest & | msg | ) |
Definition at line 519 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_write | ( | const api::BluetoothGATTWriteRequest & | msg | ) |
Definition at line 477 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_write_descriptor | ( | const api::BluetoothGATTWriteDescriptorRequest & | msg | ) |
Definition at line 505 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_scanner_set_mode | ( | bool | active | ) |
Definition at line 632 of file bluetooth_proxy.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 147 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::flush_pending_advertisements | ( | ) |
Definition at line 99 of file bluetooth_proxy.cpp.
|
overridevirtual |
Reimplemented from esphome::esp32_ble_tracker::ESPBTDeviceListener.
Definition at line 308 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 80 of file bluetooth_proxy.h.
int esphome::bluetooth_proxy::BluetoothProxy::get_bluetooth_connections_free | ( | ) |
Definition at line 154 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 76 of file bluetooth_proxy.h.
|
inline |
Definition at line 126 of file bluetooth_proxy.h.
|
protected |
Definition at line 314 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 111 of file bluetooth_proxy.h.
|
inline |
Definition at line 104 of file bluetooth_proxy.h.
|
inline |
Definition at line 102 of file bluetooth_proxy.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 168 of file bluetooth_proxy.cpp.
|
overridevirtual |
Implements esphome::esp32_ble_tracker::ESPBTDeviceListener.
Definition at line 45 of file bluetooth_proxy.cpp.
|
overridevirtual |
Reimplemented from esphome::esp32_ble_tracker::ESPBTDeviceListener.
Definition at line 61 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 62 of file bluetooth_proxy.h.
|
protected |
Definition at line 109 of file bluetooth_proxy.cpp.
|
protected |
Definition at line 37 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::send_connections_free | ( | ) |
Definition at line 582 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::send_device_clear_cache | ( | uint64_t | address, |
bool | success, | ||
esp_err_t | error = ESP_OK ) |
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 572 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::send_device_pairing | ( | uint64_t | address, |
bool | paired, | ||
esp_err_t | error = ESP_OK ) |
Definition at line 614 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::send_device_unpairing | ( | uint64_t | address, |
bool | success, | ||
esp_err_t | error = ESP_OK ) |
Definition at line 623 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::send_gatt_error | ( | uint64_t | address, |
uint16_t | handle, | ||
esp_err_t | error ) |
Definition at line 604 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::send_gatt_services_done | ( | uint64_t | address | ) |
Definition at line 596 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 101 of file bluetooth_proxy.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 29 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::subscribe_api_connection | ( | api::APIConnection * | api_connection, |
uint32_t | flags ) |
Definition at line 550 of file bluetooth_proxy.cpp.
|
inlinestatic |
Definition at line 92 of file bluetooth_proxy.h.
void esphome::bluetooth_proxy::BluetoothProxy::unsubscribe_api_connection | ( | api::APIConnection * | api_connection | ) |
Definition at line 562 of file bluetooth_proxy.cpp.
|
protected |
Definition at line 137 of file bluetooth_proxy.h.
|
protected |
Definition at line 140 of file bluetooth_proxy.h.
|
protected |
Definition at line 139 of file bluetooth_proxy.h.
|
protected |
Definition at line 141 of file bluetooth_proxy.h.