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());
38 if (enabled == this->enabled)
41 ESP_LOGI(TAG,
"[%s] Disabling BLE client.", this->
address_str().c_str());
44 ESP_LOGW(TAG,
"esp_ble_gattc_close error, address=%s status=%d", this->
address_str().c_str(), ret);
51 esp_ble_gattc_cb_param_t *param) {
57 for (
auto *node : this->
nodes_)
58 node->gattc_event_handler(event, esp_gattc_if, param);
64 this->services_.clear();
72 for (
auto *node : this->
nodes_)
73 node->gap_event_handler(event, param);
79 node->node_state =
state;
83 if (this->
state() != espbt::ClientState::ESTABLISHED)
85 for (
auto &node :
nodes_) {
86 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 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