esp-nimble-cpp / NimBLE-Arduino  1.3.1
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)
 NimBLEDescriptor constructor.
 
 NimBLEDescriptor (NimBLEUUID uuid, uint16_t properties, uint16_t max_len, NimBLECharacteristic *pCharacteristic=nullptr)
 NimBLEDescriptor constructor.
 
 ~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...
 
size_t getLength ()
 Get the length of the value of this descriptor. More...
 
uint8_t * getValue ()
 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::string &value)
 Set the value of the descriptor. More...
 
NimBLECharacteristicgetCharacteristic ()
 Get the characteristic this descriptor belongs to. More...
 
template<typename T >
void setValue (const T &s)
 Convenience template to set the descriptor value to <type>val. 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.