ESPHome 2025.9.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 {
11namespace ble_client {
12
14
16 public:
17 void dump_config() override;
18 void loop() override {}
19 void set_service_uuid16(uint16_t uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_uint16(uuid); }
20 void set_service_uuid32(uint32_t uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_uint32(uuid); }
21 void set_service_uuid128(uint8_t *uuid) { this->service_uuid_ = espbt::ESPBTUUID::from_raw(uuid); }
22 void set_char_uuid16(uint16_t uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_uint16(uuid); }
23 void set_char_uuid32(uint32_t uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_uint32(uuid); }
24 void set_char_uuid128(uint8_t *uuid) { this->char_uuid_ = espbt::ESPBTUUID::from_raw(uuid); }
25 void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
26 esp_ble_gattc_cb_param_t *param) override;
27 void set_require_response(bool response) { this->require_response_ = response; }
28
29 protected:
30 void write_state(bool state) override;
34 uint16_t char_handle_{};
35 esp_gatt_char_prop_t char_props_{};
36 esp_gatt_write_type_t write_type_{};
37};
38
39} // namespace ble_client
40} // namespace esphome
41
42#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
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7