NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
NimBLEDescriptor Class Reference

A model of a BLE descriptor. More...

#include <NimBLEDescriptor.h>

Inherits NimBLELocalValueAttribute.

Inherited by NimBLE2904.

Public Member Functions

 NimBLEDescriptor (const char *uuid, uint16_t properties, uint16_t maxLen, NimBLECharacteristic *pCharacteristic=nullptr)
 Construct a descriptor.
 
 NimBLEDescriptor (const NimBLEUUID &uuid, uint16_t properties, uint16_t maxLen, NimBLECharacteristic *pCharacteristic=nullptr)
 Construct a descriptor.
 
std::string toString () const
 Return a string representation of the descriptor.
 
void setCallbacks (NimBLEDescriptorCallbacks *pCallbacks)
 Set the callback handlers for this descriptor.
 
NimBLECharacteristicgetCharacteristic () const
 Get the characteristic this descriptor belongs to.
 

Detailed Description

A model of a BLE descriptor.

Constructor & Destructor Documentation

◆ NimBLEDescriptor() [1/2]

NimBLEDescriptor::NimBLEDescriptor ( const char *  uuid,
uint16_t  properties,
uint16_t  max_len,
NimBLECharacteristic pCharacteristic = nullptr 
)

Construct a descriptor.

Parameters
[in]uuid- UUID (const char*) for the descriptor.
[in]properties- Properties for the descriptor.
[in]max_len- The maximum length in bytes that the descriptor value can hold. (Default: 512 bytes for esp32, 20 for all others).
[in]pCharacteristic- pointer to the characteristic instance this descriptor belongs to.

◆ NimBLEDescriptor() [2/2]

NimBLEDescriptor::NimBLEDescriptor ( const NimBLEUUID uuid,
uint16_t  properties,
uint16_t  max_len,
NimBLECharacteristic pCharacteristic = nullptr 
)

Construct a descriptor.

Parameters
[in]uuid- UUID (const char*) for the descriptor.
[in]properties- Properties for the descriptor.
[in]max_len- The maximum length in bytes that the descriptor value can hold. (Default: 512 bytes for esp32, 20 for all others).
[in]pCharacteristic- pointer to the characteristic instance this descriptor belongs to.

Member Function Documentation

◆ getCharacteristic()

NimBLECharacteristic * NimBLEDescriptor::getCharacteristic ( ) const

Get the characteristic this descriptor belongs to.

Returns
A pointer to the characteristic this descriptor belongs to.

◆ setCallbacks()

void NimBLEDescriptor::setCallbacks ( NimBLEDescriptorCallbacks pCallbacks)

Set the callback handlers for this descriptor.

Parameters
[in]pCallbacksAn instance of a callback structure used to define any callbacks for the descriptor.

◆ toString()

std::string NimBLEDescriptor::toString ( ) const

Return a string representation of the descriptor.

Returns
A string representation of the descriptor.