ESPHome  2024.10.2
Public Member Functions | Protected Types | Protected Attributes
esphome::esp32_ble_server::BLEDescriptor Class Reference

#include <ble_descriptor.h>

Inheritance diagram for esphome::esp32_ble_server::BLEDescriptor:
esphome::esp32_ble_server::BLE2901 esphome::esp32_ble_server::BLE2902

Public Member Functions

 BLEDescriptor (ESPBTUUID uuid, uint16_t max_len=100)
 
virtual ~BLEDescriptor ()
 
void do_create (BLECharacteristic *characteristic)
 
void set_value (const std::string &value)
 
void set_value (const uint8_t *data, size_t length)
 
void gatts_event_handler (esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
 
bool is_created ()
 
bool is_failed ()
 

Protected Types

enum  State : uint8_t { FAILED = 0x00, INIT, CREATING, CREATED }
 

Protected Attributes

BLECharacteristiccharacteristic_ {nullptr}
 
ESPBTUUID uuid_
 
uint16_t handle_ {0xFFFF}
 
esp_attr_value_t value_
 
esp_gatt_perm_t permissions_ = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE
 
enum esphome::esp32_ble_server::BLEDescriptor::State INIT
 

Detailed Description

Definition at line 17 of file ble_descriptor.h.

Member Enumeration Documentation

◆ State

Enumerator
FAILED 
INIT 
CREATING 
CREATED 

Definition at line 40 of file ble_descriptor.h.

Constructor & Destructor Documentation

◆ BLEDescriptor()

esphome::esp32_ble_server::BLEDescriptor::BLEDescriptor ( ESPBTUUID  uuid,
uint16_t  max_len = 100 
)

Definition at line 15 of file ble_descriptor.cpp.

◆ ~BLEDescriptor()

esphome::esp32_ble_server::BLEDescriptor::~BLEDescriptor ( )
virtual

Definition at line 22 of file ble_descriptor.cpp.

Member Function Documentation

◆ do_create()

void esphome::esp32_ble_server::BLEDescriptor::do_create ( BLECharacteristic characteristic)

Definition at line 24 of file ble_descriptor.cpp.

◆ gatts_event_handler()

void esphome::esp32_ble_server::BLEDescriptor::gatts_event_handler ( esp_gatts_cb_event_t  event,
esp_gatt_if_t  gatts_if,
esp_ble_gatts_cb_param_t *  param 
)

Definition at line 51 of file ble_descriptor.cpp.

◆ is_created()

bool esphome::esp32_ble_server::BLEDescriptor::is_created ( )
inline

Definition at line 28 of file ble_descriptor.h.

◆ is_failed()

bool esphome::esp32_ble_server::BLEDescriptor::is_failed ( )
inline

Definition at line 29 of file ble_descriptor.h.

◆ set_value() [1/2]

void esphome::esp32_ble_server::BLEDescriptor::set_value ( const std::string &  value)

Definition at line 41 of file ble_descriptor.cpp.

◆ set_value() [2/2]

void esphome::esp32_ble_server::BLEDescriptor::set_value ( const uint8_t *  data,
size_t  length 
)

Definition at line 42 of file ble_descriptor.cpp.

Field Documentation

◆ characteristic_

BLECharacteristic* esphome::esp32_ble_server::BLEDescriptor::characteristic_ {nullptr}
protected

Definition at line 32 of file ble_descriptor.h.

◆ handle_

uint16_t esphome::esp32_ble_server::BLEDescriptor::handle_ {0xFFFF}
protected

Definition at line 34 of file ble_descriptor.h.

◆ INIT

enum esphome::esp32_ble_server::BLEDescriptor::State esphome::esp32_ble_server::BLEDescriptor::INIT
protected

◆ permissions_

esp_gatt_perm_t esphome::esp32_ble_server::BLEDescriptor::permissions_ = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE
protected

Definition at line 38 of file ble_descriptor.h.

◆ uuid_

ESPBTUUID esphome::esp32_ble_server::BLEDescriptor::uuid_
protected

Definition at line 33 of file ble_descriptor.h.

◆ value_

esp_attr_value_t esphome::esp32_ble_server::BLEDescriptor::value_
protected

Definition at line 36 of file ble_descriptor.h.


The documentation for this class was generated from the following files: