11 namespace ble_client {
13 static const char *
const TAG =
"ble_client";
22 for (
auto *node : this->
nodes_)
27 ESP_LOGCONFIG(TAG,
"BLE Client:");
28 ESP_LOGCONFIG(TAG,
" Address: %s", this->
address_str().c_str());
29 ESP_LOGCONFIG(TAG,
" Auto-Connect: %s", TRUEFALSE(this->
auto_connect_));
39 if (enabled == this->enabled)
43 ESP_LOGI(TAG,
"[%s] Disabling BLE client.", this->
address_str().c_str());
49 esp_ble_gattc_cb_param_t *param) {
53 for (
auto *node : this->
nodes_)
54 node->gattc_event_handler(event, esp_gattc_if, param);
58 ESP_LOGD(TAG,
"All clients established, services released");
66 for (
auto *node : this->
nodes_)
67 node->gap_event_handler(event, param);
73 node->node_state =
state;
77 if (this->
state() != espbt::ClientState::ESTABLISHED)
79 for (
auto &node :
nodes_) {
80 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
void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override
std::vector< BLEService * > services_
bool parse_device(const espbt::ESPBTDevice &device) override
std::string address_str() const
void disconnect() override
void set_enabled(bool enabled)
virtual void set_state(ClientState st)
ClientState state() const
void set_state(espbt::ClientState state) override
std::vector< BLEClientNode * > nodes_
void dump_config() override
void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override
bool all_nodes_established_()
Implementation of SPI Controller mode.
bool parse_device(const espbt::ESPBTDevice &device) 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