13static const char *
const TAG =
"ble_client";
22 for (
auto *node : this->
nodes_)
27 ESP_LOGCONFIG(TAG,
"BLE Client:");
42 ESP_LOGI(TAG,
"[%s] Disabling BLE client.", this->
address_str().c_str());
48 esp_ble_gattc_cb_param_t *param) {
52 for (
auto *node : this->
nodes_)
53 node->gattc_event_handler(event, esp_gattc_if, param);
55 if (!this->
services_.empty() && this->all_nodes_established_()) {
57 ESP_LOGD(TAG,
"All clients established, services released");
65 for (
auto *node : this->
nodes_)
66 node->gap_event_handler(event, param);
70 BLEClientBase::set_state(
state);
72 node->node_state =
state;
76 if (this->
state() != espbt::ClientState::ESTABLISHED)
78 for (
auto &node :
nodes_) {
79 if (node->node_state != espbt::ClientState::ESTABLISHED)
bool 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 gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override
void set_state(espbt::ClientState state) override
bool all_nodes_established_()
std::vector< BLEClientNode * > nodes_
void set_enabled(bool enabled)
void dump_config() override
std::vector< BLEService * > services_
std::string address_str() const
void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override
void disconnect() override
bool 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 dump_config() override
ClientState state() const
Providing packet encoding functions for exchanging data with a remote host.