esp-nimble-cpp  1.4.0
NimBLE2904 Class Reference

Descriptor for Characteristic Presentation Format. More...

Inherits NimBLEDescriptor.

Public Member Functions

void setDescription (uint16_t)
 Set the description.
 
void setExponent (int8_t exponent)
 Set the exponent.
 
void setFormat (uint8_t format)
 Set the format.
 
void setNamespace (uint8_t namespace_value)
 Set the namespace.
 
void setUnit (uint16_t unit)
 Set the units for this value. It should be one of the encoded values defined here: https://www.bluetooth.com/specifications/assigned-numbers/units. More...
 
- Public Member Functions inherited from NimBLEDescriptor
 NimBLEDescriptor (const char *uuid, uint16_t properties, uint16_t max_len, NimBLECharacteristic *pCharacteristic=nullptr)
 Construct a descriptor. More...
 
 NimBLEDescriptor (NimBLEUUID uuid, uint16_t properties, uint16_t max_len, NimBLECharacteristic *pCharacteristic=nullptr)
 Construct a descriptor. More...
 
 ~NimBLEDescriptor ()
 NimBLEDescriptor destructor.
 
uint16_t getHandle ()
 Get the BLE handle for this descriptor. More...
 
NimBLEUUID getUUID ()
 Get the UUID of the descriptor.
 
std::string toString ()
 Return a string representation of the descriptor. More...
 
void setCallbacks (NimBLEDescriptorCallbacks *pCallbacks)
 Set the callback handlers for this descriptor. More...
 
NimBLECharacteristicgetCharacteristic ()
 Get the characteristic this descriptor belongs to. More...
 
size_t getLength ()
 Get the length of the value of this descriptor. More...
 
NimBLEAttValue getValue (time_t *timestamp=nullptr)
 Get the value of this descriptor. More...
 
std::string getStringValue ()
 Get the value of this descriptor as a string. More...
 
void setValue (const uint8_t *data, size_t size)
 Set the value of the descriptor. More...
 
void setValue (const std::vector< uint8_t > &vec)
 Set the value of the descriptor from a std::vector<uint8_t>.
. More...
 
template<typename T >
void setValue (const T &s)
 Template to set the characteristic value to <type>val. More...
 
template<typename T >
getValue (time_t *timestamp=nullptr, bool skipSizeCheck=false)
 Template to convert the descriptor data to <type>. More...
 

Detailed Description

Descriptor for Characteristic Presentation Format.

This is a convenience descriptor for the Characteristic Presentation Format which has a UUID of 0x2904.

See also: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml

Member Function Documentation

◆ setUnit()

void NimBLE2904::setUnit ( uint16_t  unit)

Set the units for this value. It should be one of the encoded values defined here: https://www.bluetooth.com/specifications/assigned-numbers/units.

Parameters
[in]unitThe type of units of this characteristic as defined by assigned numbers.