ESPHome  2025.2.0
bluetooth_connection.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef USE_ESP32
4 
6 
7 namespace esphome {
8 namespace bluetooth_proxy {
9 
10 class BluetoothProxy;
11 
13  public:
14  void dump_config() override;
15  bool gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
16  esp_ble_gattc_cb_param_t *param) override;
17  void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override;
19 
20  esp_err_t read_characteristic(uint16_t handle);
21  esp_err_t write_characteristic(uint16_t handle, const std::string &data, bool response);
22  esp_err_t read_descriptor(uint16_t handle);
23  esp_err_t write_descriptor(uint16_t handle, const std::string &data, bool response);
24 
25  esp_err_t notify_characteristic(uint16_t handle, bool enable);
26 
27  protected:
28  friend class BluetoothProxy;
29  bool seen_mtu_or_services_{false};
30 
31  int16_t send_service_{-2};
33 };
34 
35 } // namespace bluetooth_proxy
36 } // namespace esphome
37 
38 #endif // USE_ESP32
void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override
esp_err_t write_descriptor(uint16_t handle, const std::string &data, bool response)
esp_err_t write_characteristic(uint16_t handle, const std::string &data, bool response)
bool gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
esp32_ble_tracker::AdvertisementParserType get_advertisement_parser_type() override
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
esp_err_t notify_characteristic(uint16_t handle, bool enable)