ESPHome  2025.2.0
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::event_emitter::EventEmitter< BLEDescriptorEvt::VectorEvt, std::vector< uint8_t >, uint16_t > esphome::esp32_ble_server::BLE2902

Public Member Functions

 BLEDescriptor (ESPBTUUID uuid, uint16_t max_len=100, bool read=true, bool write=true)
 
virtual ~BLEDescriptor ()
 
void do_create (BLECharacteristic *characteristic)
 
ESPBTUUID get_uuid () const
 
void set_value (std::vector< uint8_t > buffer)
 
void set_value (ByteBuffer buffer)
 
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 ()
 
- Public Member Functions inherited from esphome::event_emitter::EventEmitter< BLEDescriptorEvt::VectorEvt, std::vector< uint8_t >, uint16_t >
EventEmitterListenerID on (BLEDescriptorEvt::VectorEvt event, std::function< void(Args...)> listener)
 
void off (BLEDescriptorEvt::VectorEvt event, EventEmitterListenerID id)
 

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_ {}
 
enum esphome::esp32_ble_server::BLEDescriptor::State INIT
 

Additional Inherited Members

- Protected Member Functions inherited from esphome::event_emitter::EventEmitter< BLEDescriptorEvt::VectorEvt, std::vector< uint8_t >, uint16_t >
void emit_ (BLEDescriptorEvt::VectorEvt event, Args... args)
 
EventEmitterListenerID get_next_id_ (BLEDescriptorEvt::VectorEvt event)
 

Detailed Description

Definition at line 27 of file ble_descriptor.h.

Member Enumeration Documentation

◆ State

Enumerator
FAILED 
INIT 
CREATING 
CREATED 

Definition at line 51 of file ble_descriptor.h.

Constructor & Destructor Documentation

◆ BLEDescriptor()

esphome::esp32_ble_server::BLEDescriptor::BLEDescriptor ( ESPBTUUID  uuid,
uint16_t  max_len = 100,
bool  read = true,
bool  write = true 
)

Definition at line 17 of file ble_descriptor.cpp.

◆ ~BLEDescriptor()

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

Definition at line 30 of file ble_descriptor.cpp.

Member Function Documentation

◆ do_create()

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

Definition at line 32 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 60 of file ble_descriptor.cpp.

◆ get_uuid()

ESPBTUUID esphome::esp32_ble_server::BLEDescriptor::get_uuid ( ) const
inline

Definition at line 32 of file ble_descriptor.h.

◆ is_created()

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

Definition at line 39 of file ble_descriptor.h.

◆ is_failed()

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

Definition at line 40 of file ble_descriptor.h.

◆ set_value() [1/2]

void esphome::esp32_ble_server::BLEDescriptor::set_value ( std::vector< uint8_t >  buffer)

Definition at line 49 of file ble_descriptor.cpp.

◆ set_value() [2/2]

void esphome::esp32_ble_server::BLEDescriptor::set_value ( ByteBuffer  buffer)
inline

Definition at line 35 of file ble_descriptor.h.

Field Documentation

◆ characteristic_

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

Definition at line 43 of file ble_descriptor.h.

◆ handle_

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

Definition at line 45 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_ {}
protected

Definition at line 49 of file ble_descriptor.h.

◆ uuid_

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

Definition at line 44 of file ble_descriptor.h.

◆ value_

esp_attr_value_t esphome::esp32_ble_server::BLEDescriptor::value_ {}
protected

Definition at line 47 of file ble_descriptor.h.


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