19 namespace bluetooth_proxy {
21 static const esp_err_t ESP_GATT_NOT_CONNECTED = -1;
23 using namespace esp32_ble_client;
31 static const uint32_t LEGACY_ACTIVE_CONNECTIONS_VERSION = 5;
32 static const uint32_t LEGACY_PASSIVE_ONLY_VERSION = 1;
51 bool parse_devices(esp_ble_gap_cb_param_t::ble_scan_result_evt_param *advertisements,
size_t count)
override;
52 void dump_config()
override;
57 this->connections_.push_back(connection);
69 int get_bluetooth_connections_free();
76 void send_device_connection(uint64_t
address,
bool connected, uint16_t mtu = 0, esp_err_t error = ESP_OK);
77 void send_connections_free();
78 void send_gatt_services_done(uint64_t address);
79 void send_gatt_error(uint64_t address, uint16_t handle, esp_err_t error);
80 void send_device_pairing(uint64_t address,
bool paired, esp_err_t error = ESP_OK);
81 void send_device_unpairing(uint64_t address,
bool success, esp_err_t error = ESP_OK);
82 void send_device_clear_cache(uint64_t address,
bool success, esp_err_t error = ESP_OK);
85 bd_addr[0] = (address >> 40) & 0xff;
86 bd_addr[1] = (address >> 32) & 0xff;
87 bd_addr[2] = (address >> 24) & 0xff;
88 bd_addr[3] = (address >> 16) & 0xff;
89 bd_addr[4] = (address >> 8) & 0xff;
90 bd_addr[5] = (address >> 0) & 0xff;
98 return LEGACY_ACTIVE_CONNECTIONS_VERSION;
100 return LEGACY_PASSIVE_ONLY_VERSION;
124 std::vector<BluetoothConnection *> connections_{};
126 bool raw_advertisements_{
false};
int get_bluetooth_connections_limit()
BluetoothProxy * global_bluetooth_proxy
api::APIConnection * get_api_connection()
BluetoothProxySubscriptionFlag
uint32_t get_legacy_version() const
void set_active(bool active)
static void uint64_to_bd_addr(uint64_t address, esp_bd_addr_t bd_addr)
uint32_t get_feature_flags() const
Implementation of SPI Controller mode.
void register_connection(BluetoothConnection *connection)