8#include <esp_gatt_defs.h>
9#include <esp_gatts_api.h>
15namespace esp32_ble_server {
17using namespace esp32_ble;
18using namespace bytebuffer;
20class BLECharacteristic;
30 void set_value(std::vector<uint8_t> &&buffer);
31 void set_value(std::initializer_list<uint8_t> data);
34 void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
40 void on_write(std::function<
void(std::span<const uint8_t>, uint16_t)> &&callback) {
42 std::make_unique<std::function<void(std::span<const uint8_t>, uint16_t)>>(std::move(callback));
A class modelled on the Java ByteBuffer class.
std::vector< uint8_t > get_data()
enum esphome::esp32_ble_server::BLEDescriptor::State INIT
esp_gatt_perm_t permissions_
std::unique_ptr< std::function< void(std::span< const uint8_t >, uint16_t)> > on_write_callback_
void set_value(ByteBuffer buffer)
void on_write(std::function< void(std::span< const uint8_t >, uint16_t)> &&callback)
void set_value(std::vector< uint8_t > &&buffer)
void set_value_impl_(const uint8_t *data, size_t length)
void do_create(BLECharacteristic *characteristic)
void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
BLEDescriptor(ESPBTUUID uuid, uint16_t max_len=100, bool read=true, bool write=true)
ESPBTUUID get_uuid() const
BLECharacteristic * characteristic_
Providing packet encoding functions for exchanging data with a remote host.