ESPHome  2021.11.3
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
esphome::ble_client::BLEClient Class Reference

#include <ble_client.h>

Inheritance diagram for esphome::ble_client::BLEClient:
esphome::esp32_ble_tracker::ESPBTClient esphome::Component esphome::esp32_ble_tracker::ESPBTDeviceListener

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
 
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)
 
BLEServiceget_service (espbt::ESPBTUUID uuid)
 
BLEServiceget_service (uint16_t uuid)
 
BLECharacteristicget_characteristic (espbt::ESPBTUUID service, espbt::ESPBTUUID chr)
 
BLECharacteristicget_characteristic (uint16_t service, uint16_t chr)
 
BLEDescriptorget_descriptor (espbt::ESPBTUUID service, espbt::ESPBTUUID chr, espbt::ESPBTUUID descr)
 
BLEDescriptorget_descriptor (uint16_t service, uint16_t chr, uint16_t descr)
 
BLEDescriptorget_config_descriptor (uint16_t handle)
 
float parse_char_value (uint8_t *value, uint16_t length)
 
std::string address_str () const
 
- Public Member Functions inherited from esphome::esp32_ble_tracker::ESPBTClient
void set_state (ClientState st)
 
ClientState state () const
 
- Public Member Functions inherited from esphome::esp32_ble_tracker::ESPBTDeviceListener
void set_parent (ESP32BLETracker *parent)
 
- Public Member Functions inherited from esphome::Component
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
 
- Data Fields inherited from esphome::esp32_ble_tracker::ESPBTClient
int app_id
 

Protected Member Functions

void set_states_ (espbt::ClientState st)
 
bool all_nodes_established_ ()
 
- 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_timeout (uint32_t timeout, std::function< void()> &&f)
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
 
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_
 
- Protected Attributes inherited from esphome::esp32_ble_tracker::ESPBTClient
ClientState state_
 
- 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 79 of file ble_client.h.

Member Function Documentation

◆ address_str()

std::string esphome::ble_client::BLEClient::address_str ( ) const

Definition at line 60 of file ble_client.cpp.

◆ all_nodes_established_()

bool esphome::ble_client::BLEClient::all_nodes_established_ ( )
inlineprotected

Definition at line 126 of file ble_client.h.

◆ connect()

void esphome::ble_client::BLEClient::connect ( )
overridevirtual

Implements esphome::esp32_ble_tracker::ESPBTClient.

Definition at line 84 of file ble_client.cpp.

◆ dump_config()

void esphome::ble_client::BLEClient::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 34 of file ble_client.cpp.

◆ gattc_event_handler()

void esphome::ble_client::BLEClient::gattc_event_handler ( esp_gattc_cb_event_t  event,
esp_gatt_if_t  gattc_if,
esp_ble_gattc_cb_param_t *  param 
)
overridevirtual

Implements esphome::esp32_ble_tracker::ESPBTClient.

Definition at line 95 of file ble_client.cpp.

◆ get_characteristic() [1/2]

BLECharacteristic * esphome::ble_client::BLEClient::get_characteristic ( espbt::ESPBTUUID  service,
espbt::ESPBTUUID  chr 
)

Definition at line 263 of file ble_client.cpp.

◆ get_characteristic() [2/2]

BLECharacteristic * esphome::ble_client::BLEClient::get_characteristic ( uint16_t  service,
uint16_t  chr 
)

Definition at line 270 of file ble_client.cpp.

◆ get_config_descriptor()

BLEDescriptor * esphome::ble_client::BLEClient::get_config_descriptor ( uint16_t  handle)

Definition at line 274 of file ble_client.cpp.

◆ get_descriptor() [1/2]

BLEDescriptor * esphome::ble_client::BLEClient::get_descriptor ( espbt::ESPBTUUID  service,
espbt::ESPBTUUID  chr,
espbt::ESPBTUUID  descr 
)

Definition at line 295 of file ble_client.cpp.

◆ get_descriptor() [2/2]

BLEDescriptor * esphome::ble_client::BLEClient::get_descriptor ( uint16_t  service,
uint16_t  chr,
uint16_t  descr 
)

Definition at line 305 of file ble_client.cpp.

◆ get_service() [1/2]

BLEService * esphome::ble_client::BLEClient::get_service ( espbt::ESPBTUUID  uuid)

Definition at line 254 of file ble_client.cpp.

◆ get_service() [2/2]

BLEService * esphome::ble_client::BLEClient::get_service ( uint16_t  uuid)

Definition at line 261 of file ble_client.cpp.

◆ get_setup_priority()

float esphome::ble_client::BLEClient::get_setup_priority ( ) const
overridevirtual

Reimplemented from esphome::Component.

Definition at line 14 of file ble_client.cpp.

◆ loop()

void esphome::ble_client::BLEClient::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 26 of file ble_client.cpp.

◆ on_scan_end()

void esphome::ble_client::BLEClient::on_scan_end ( )
inlineoverridevirtual

Reimplemented from esphome::esp32_ble_tracker::ESPBTDeviceListener.

Definition at line 89 of file ble_client.h.

◆ parse_char_value()

float esphome::ble_client::BLEClient::parse_char_value ( uint8_t *  value,
uint16_t  length 
)

Definition at line 206 of file ble_client.cpp.

◆ parse_device()

bool esphome::ble_client::BLEClient::parse_device ( const espbt::ESPBTDevice device)
overridevirtual

Implements esphome::esp32_ble_tracker::ESPBTDeviceListener.

Definition at line 39 of file ble_client.cpp.

◆ register_ble_node()

void esphome::ble_client::BLEClient::register_ble_node ( BLEClientNode node)
inline

Definition at line 96 of file ble_client.h.

◆ set_address()

void esphome::ble_client::BLEClient::set_address ( uint64_t  address)
inline

Definition at line 92 of file ble_client.h.

◆ set_enabled()

void esphome::ble_client::BLEClient::set_enabled ( bool  enabled)

Definition at line 71 of file ble_client.cpp.

◆ set_states_()

void esphome::ble_client::BLEClient::set_states_ ( espbt::ClientState  st)
inlineprotected

Definition at line 121 of file ble_client.h.

◆ setup()

void esphome::ble_client::BLEClient::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 16 of file ble_client.cpp.

Field Documentation

◆ address

uint64_t esphome::ble_client::BLEClient::address

Definition at line 116 of file ble_client.h.

◆ conn_id

uint16_t esphome::ble_client::BLEClient::conn_id

Definition at line 115 of file ble_client.h.

◆ enabled

bool esphome::ble_client::BLEClient::enabled

Definition at line 117 of file ble_client.h.

◆ gattc_if

int esphome::ble_client::BLEClient::gattc_if

Definition at line 113 of file ble_client.h.

◆ nodes_

std::vector<BLEClientNode *> esphome::ble_client::BLEClient::nodes_
protected

Definition at line 135 of file ble_client.h.

◆ remote_bda

esp_bd_addr_t esphome::ble_client::BLEClient::remote_bda

Definition at line 114 of file ble_client.h.

◆ services_

std::vector<BLEService *> esphome::ble_client::BLEClient::services_
protected

Definition at line 136 of file ble_client.h.


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