ESPHome
2022.4.0
|
#include <ble_client.h>
Public Member Functions | |
void | setup () override |
void | dump_config () override |
void | loop () override |
float | get_setup_priority () const override |
void | gattc_event_handler (esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override |
void | gap_event_handler (esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override |
bool | parse_device (const espbt::ESPBTDevice &device) override |
void | on_scan_end () override |
void | connect () override |
void | set_address (uint64_t address) |
void | set_enabled (bool enabled) |
void | register_ble_node (BLEClientNode *node) |
BLEService * | get_service (espbt::ESPBTUUID uuid) |
BLEService * | get_service (uint16_t uuid) |
BLECharacteristic * | get_characteristic (espbt::ESPBTUUID service, espbt::ESPBTUUID chr) |
BLECharacteristic * | get_characteristic (uint16_t service, uint16_t chr) |
BLEDescriptor * | get_descriptor (espbt::ESPBTUUID service, espbt::ESPBTUUID chr, espbt::ESPBTUUID descr) |
BLEDescriptor * | get_descriptor (uint16_t service, uint16_t chr, uint16_t descr) |
BLEDescriptor * | get_config_descriptor (uint16_t handle) |
float | parse_char_value (uint8_t *value, uint16_t length) |
std::string | address_str () const |
![]() | |
void | set_state (ClientState st) |
ClientState | state () const |
![]() | |
void | set_parent (ESP32BLETracker *parent) |
![]() | |
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 () |
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... | |
Data Fields | |
int | gattc_if |
esp_bd_addr_t | remote_bda |
uint16_t | conn_id |
uint64_t | address |
bool | enabled |
![]() | |
int | app_id |
Protected Member Functions | |
void | set_states_ (espbt::ClientState st) |
bool | all_nodes_established_ () |
![]() | |
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()> &&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()> &&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 | |
std::vector< BLEClientNode * > | nodes_ |
std::vector< BLEService * > | services_ |
![]() | |
ClientState | state_ |
![]() | |
ESP32BLETracker * | parent_ {nullptr} |
![]() | |
uint32_t | component_state_ {0x0000} |
State of this component. More... | |
float | setup_priority_override_ {NAN} |
const char * | component_source_ = nullptr |
Definition at line 81 of file ble_client.h.
std::string esphome::ble_client::BLEClient::address_str | ( | ) | const |
Definition at line 60 of file ble_client.cpp.
|
inlineprotected |
Definition at line 129 of file ble_client.h.
|
overridevirtual |
Implements esphome::esp32_ble_tracker::ESPBTClient.
Definition at line 84 of file ble_client.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 34 of file ble_client.cpp.
|
overridevirtual |
Implements esphome::esp32_ble_tracker::ESPBTClient.
Definition at line 209 of file ble_client.cpp.
|
overridevirtual |
Implements esphome::esp32_ble_tracker::ESPBTClient.
Definition at line 95 of file ble_client.cpp.
BLECharacteristic * esphome::ble_client::BLEClient::get_characteristic | ( | espbt::ESPBTUUID | service, |
espbt::ESPBTUUID | chr | ||
) |
Definition at line 295 of file ble_client.cpp.
BLECharacteristic * esphome::ble_client::BLEClient::get_characteristic | ( | uint16_t | service, |
uint16_t | chr | ||
) |
Definition at line 302 of file ble_client.cpp.
BLEDescriptor * esphome::ble_client::BLEClient::get_config_descriptor | ( | uint16_t | handle | ) |
Definition at line 306 of file ble_client.cpp.
BLEDescriptor * esphome::ble_client::BLEClient::get_descriptor | ( | espbt::ESPBTUUID | service, |
espbt::ESPBTUUID | chr, | ||
espbt::ESPBTUUID | descr | ||
) |
Definition at line 332 of file ble_client.cpp.
BLEDescriptor * esphome::ble_client::BLEClient::get_descriptor | ( | uint16_t | service, |
uint16_t | chr, | ||
uint16_t | descr | ||
) |
Definition at line 342 of file ble_client.cpp.
BLEService * esphome::ble_client::BLEClient::get_service | ( | espbt::ESPBTUUID | uuid | ) |
Definition at line 285 of file ble_client.cpp.
BLEService * esphome::ble_client::BLEClient::get_service | ( | uint16_t | uuid | ) |
Definition at line 293 of file ble_client.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 14 of file ble_client.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 26 of file ble_client.cpp.
|
inlineoverridevirtual |
Reimplemented from esphome::esp32_ble_tracker::ESPBTDeviceListener.
Definition at line 92 of file ble_client.h.
float esphome::ble_client::BLEClient::parse_char_value | ( | uint8_t * | value, |
uint16_t | length | ||
) |
Definition at line 237 of file ble_client.cpp.
|
overridevirtual |
Implements esphome::esp32_ble_tracker::ESPBTDeviceListener.
Definition at line 39 of file ble_client.cpp.
|
inline |
Definition at line 99 of file ble_client.h.
|
inline |
Definition at line 95 of file ble_client.h.
void esphome::ble_client::BLEClient::set_enabled | ( | bool | enabled | ) |
Definition at line 71 of file ble_client.cpp.
|
inlineprotected |
Definition at line 124 of file ble_client.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 16 of file ble_client.cpp.
uint64_t esphome::ble_client::BLEClient::address |
Definition at line 119 of file ble_client.h.
uint16_t esphome::ble_client::BLEClient::conn_id |
Definition at line 118 of file ble_client.h.
bool esphome::ble_client::BLEClient::enabled |
Definition at line 120 of file ble_client.h.
int esphome::ble_client::BLEClient::gattc_if |
Definition at line 116 of file ble_client.h.
|
protected |
Definition at line 139 of file ble_client.h.
esp_bd_addr_t esphome::ble_client::BLEClient::remote_bda |
Definition at line 117 of file ble_client.h.
|
protected |
Definition at line 140 of file ble_client.h.