ESPHome  2022.6.3
ble_binary_output.h
Go to the documentation of this file.
1 #pragma once
2 
7 
8 #ifdef USE_ESP32
9 #include <esp_gattc_api.h>
10 namespace esphome {
11 namespace ble_client {
12 
14 
16  public:
17  void dump_config() override;
18  void loop() override {}
19  float get_setup_priority() const override { return setup_priority::DATA; }
20  void set_service_uuid16(uint16_t uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_uint16(uuid); }
21  void set_service_uuid32(uint32_t uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_uint32(uuid); }
22  void set_service_uuid128(uint8_t *uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_raw(uuid); }
23  void set_char_uuid16(uint16_t uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_uint16(uuid); }
24  void set_char_uuid32(uint32_t uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_uint32(uuid); }
25  void set_char_uuid128(uint8_t *uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_raw(uuid); }
26  void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
27  esp_ble_gattc_cb_param_t *param) override;
28  void set_require_response(bool response) { this->require_response_ = response; }
29 
30  protected:
31  void write_state(bool state) override;
36 };
37 
38 } // namespace ble_client
39 } // namespace esphome
40 
41 #endif
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:18
void write_state(bool state) override
static ESPBTUUID from_raw(const uint8_t *data)
float get_setup_priority() const override
static ESPBTUUID from_uint16(uint16_t uuid)
static ESPBTUUID from_uint32(uint32_t uuid)
Definition: a4988.cpp:4
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
bool state
Definition: fan.h:34