ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
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>
10namespace esphome::ble_client {
11
13
15 public:
16 void dump_config() override;
17 void loop() override {}
18 void set_service_uuid16(uint16_t uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_uint16(uuid); }
19 void set_service_uuid32(uint32_t uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_uint32(uuid); }
20 void set_service_uuid128(uint8_t *uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_raw(uuid); }
21 void set_char_uuid16(uint16_t uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_uint16(uuid); }
22 void set_char_uuid32(uint32_t uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_uint32(uuid); }
23 void set_char_uuid128(uint8_t *uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_raw(uuid); }
24 void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
25 esp_ble_gattc_cb_param_t *param) override;
26 void set_require_response(bool response) { this->require_response_ = response; }
27
28 protected:
29 void write_state(bool state) override;
33 uint16_t char_handle_{};
34 esp_gatt_char_prop_t char_props_{};
35 esp_gatt_write_type_t write_type_{};
36};
37
38} // namespace esphome::ble_client
39
40#endif
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:0