ESPHome  2024.11.3
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  bool gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
15  esp_ble_gattc_cb_param_t *param) override;
16  void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) override;
18 
19  esp_err_t read_characteristic(uint16_t handle);
20  esp_err_t write_characteristic(uint16_t handle, const std::string &data, bool response);
21  esp_err_t read_descriptor(uint16_t handle);
22  esp_err_t write_descriptor(uint16_t handle, const std::string &data, bool response);
23 
24  esp_err_t notify_characteristic(uint16_t handle, bool enable);
25 
26  protected:
27  friend class BluetoothProxy;
28  bool seen_mtu_or_services_{false};
29 
30  int16_t send_service_{-2};
32 };
33 
34 } // namespace bluetooth_proxy
35 } // namespace esphome
36 
37 #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)