14#include <esp_bt_defs.h>
15#include <esp_gap_ble_api.h>
16#include <esp_gatt_common_api.h>
17#include <esp_gattc_api.h>
20namespace esp32_ble_client {
24static const int UNSET_CONN_ID = 0xFFFF;
28 void setup()
override;
33 void run_later(std::function<
void()> &&f);
37 esp_ble_gattc_cb_param_t *param)
override;
38 void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
override;
62 (uint8_t) (this->
address_ >> 32) & 0xff, (uint8_t) (this->
address_ >> 24) & 0xff,
63 (uint8_t) (this->
address_ >> 16) & 0xff, (uint8_t) (this->
address_ >> 8) & 0xff,
64 (uint8_t) (this->
address_ >> 0) & 0xff);
espbt::ConnectionType connection_type_
void log_event_(const char *name)
uint8_t * get_remote_bda()
esp_gatt_status_t status_
std::vector< BLEService * > services_
void set_auto_connect(bool auto_connect)
std::string address_str() const
esp_bd_addr_t remote_bda_
uint64_t get_address() const
void set_address(uint64_t address)
BLEDescriptor * get_descriptor(espbt::ESPBTUUID service, espbt::ESPBTUUID chr, espbt::ESPBTUUID descr)
void unconditional_disconnect()
void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override
float get_setup_priority() const override
BLECharacteristic * get_characteristic(espbt::ESPBTUUID service, espbt::ESPBTUUID chr)
void on_scan_end() override
void disconnect() override
bool check_addr(esp_bd_addr_t &addr)
esp_ble_addr_type_t get_remote_addr_type() const
void run_later(std::function< void()> &&f)
uint8_t connection_index_
BLEService * get_service(espbt::ESPBTUUID uuid)
uint8_t get_connection_index() const
bool gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
esp_ble_addr_type_t remote_addr_type_
bool parse_device(const espbt::ESPBTDevice &device) override
virtual void set_connection_type(espbt::ConnectionType ct)
float parse_char_value(uint8_t *value, uint16_t length)
BLEDescriptor * get_config_descriptor(uint16_t handle)
uint16_t get_conn_id() const
void dump_config() override
void set_remote_addr_type(esp_ble_addr_type_t address_type)
Providing packet encoding functions for exchanging data with a remote host.
std::string str_snprintf(const char *fmt, size_t len,...)