12#include <esp_gap_ble_api.h>
13#include <esp_gatt_defs.h>
14#include <esp_gattc_api.h>
15#include <esp_gatts_api.h>
16#include <esp_bt_defs.h>
17#include <freertos/FreeRTOS.h>
18#include <freertos/semphr.h>
21namespace esp32_ble_server {
23using namespace esp32_ble;
24using namespace bytebuffer;
25using namespace event_emitter;
29namespace BLECharacteristicEvt {
40 public EventEmitter<BLECharacteristicEvt::EmptyEvt, uint16_t> {
46 void set_value(
const std::vector<uint8_t> &buffer);
47 void set_value(
const std::string &buffer);
60 void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
101 esp_gatt_perm_t
permissions_ = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE;
A class modelled on the Java ByteBuffer class.
void set_broadcast_property(bool value)
ClientNotificationEntry * find_client_in_notify_list_(uint16_t conn_id)
void remove_descriptor(BLEDescriptor *descriptor)
void set_write_property(bool value)
enum esphome::esp32_ble_server::BLECharacteristic::State INIT
void remove_client_from_notify_list_(uint16_t conn_id)
std::vector< uint8_t > value_
SemaphoreHandle_t set_value_lock_
void set_value(ByteBuffer buffer)
uint16_t value_read_offset_
BLEService * get_service()
BLECharacteristic(ESPBTUUID uuid, uint32_t properties)
void set_notify_property(bool value)
void set_read_property(bool value)
static const uint32_t PROPERTY_WRITE_NR
void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
esp_gatt_perm_t permissions_
static const uint32_t PROPERTY_NOTIFY
static const uint32_t PROPERTY_WRITE
void set_indicate_property(bool value)
std::vector< BLEDescriptor * > descriptors_
static const uint32_t PROPERTY_INDICATE
void set_write_no_response_property(bool value)
void add_descriptor(BLEDescriptor *descriptor)
static const uint32_t PROPERTY_READ
static const uint32_t PROPERTY_BROADCAST
std::vector< ClientNotificationEntry > clients_to_notify_
esp_gatt_char_prop_t properties_
void do_create(BLEService *service)
std::vector< uint8_t > & get_value()
Providing packet encoding functions for exchanging data with a remote host.