ESPHome
2024.12.2
|
#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 | 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::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 | 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 () 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. 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) |
BluetoothConnection * | get_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::APIConnection * | api_connection_ {nullptr} |
bool | raw_advertisements_ {false} |
Protected Attributes inherited from esphome::esp32_ble_tracker::ESPBTDeviceListener | |
ESP32BLETracker * | parent_ {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} |
Definition at line 47 of file bluetooth_proxy.h.
esphome::bluetooth_proxy::BluetoothProxy::BluetoothProxy | ( | ) |
Definition at line 26 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_device_request | ( | const api::BluetoothDeviceRequest & | msg | ) |
Definition at line 237 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_notify | ( | const api::BluetoothGATTNotifyRequest & | msg | ) |
Definition at line 428 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_read | ( | const api::BluetoothGATTReadRequest & | msg | ) |
Definition at line 355 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_read_descriptor | ( | const api::BluetoothGATTReadDescriptorRequest & | msg | ) |
Definition at line 383 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_send_services | ( | const api::BluetoothGATTGetServicesRequest & | msg | ) |
Definition at line 411 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_write | ( | const api::BluetoothGATTWriteRequest & | msg | ) |
Definition at line 369 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::bluetooth_gatt_write_descriptor | ( | const api::BluetoothGATTWriteDescriptorRequest & | msg | ) |
Definition at line 397 of file bluetooth_proxy.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 90 of file bluetooth_proxy.cpp.
|
overridevirtual |
Reimplemented from esphome::esp32_ble_tracker::ESPBTDeviceListener.
Definition at line 206 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 74 of file bluetooth_proxy.h.
int esphome::bluetooth_proxy::BluetoothProxy::get_bluetooth_connections_free | ( | ) |
Definition at line 97 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 70 of file bluetooth_proxy.h.
|
protected |
Definition at line 212 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 103 of file bluetooth_proxy.h.
|
inline |
Definition at line 96 of file bluetooth_proxy.h.
|
inline |
Definition at line 94 of file bluetooth_proxy.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 111 of file bluetooth_proxy.cpp.
|
overridevirtual |
Implements esphome::esp32_ble_tracker::ESPBTDeviceListener.
Definition at line 28 of file bluetooth_proxy.cpp.
|
overridevirtual |
Reimplemented from esphome::esp32_ble_tracker::ESPBTDeviceListener.
Definition at line 38 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 56 of file bluetooth_proxy.h.
|
protected |
Definition at line 65 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::send_connections_free | ( | ) |
Definition at line 472 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 462 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 499 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 508 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 489 of file bluetooth_proxy.cpp.
void esphome::bluetooth_proxy::BluetoothProxy::send_gatt_services_done | ( | uint64_t | address | ) |
Definition at line 481 of file bluetooth_proxy.cpp.
|
inline |
Definition at line 93 of file bluetooth_proxy.h.
void esphome::bluetooth_proxy::BluetoothProxy::subscribe_api_connection | ( | api::APIConnection * | api_connection, |
uint32_t | flags | ||
) |
Definition at line 442 of file bluetooth_proxy.cpp.
|
inlinestatic |
Definition at line 84 of file bluetooth_proxy.h.
void esphome::bluetooth_proxy::BluetoothProxy::unsubscribe_api_connection | ( | api::APIConnection * | api_connection | ) |
Definition at line 452 of file bluetooth_proxy.cpp.
|
protected |
Definition at line 122 of file bluetooth_proxy.h.
|
protected |
Definition at line 125 of file bluetooth_proxy.h.
|
protected |
Definition at line 124 of file bluetooth_proxy.h.
|
protected |
Definition at line 126 of file bluetooth_proxy.h.