SDK  23.9.2
For IoT System Software Development
Public Member Functions | Static Public Attributes | List of all members
BLE2904 Class Reference

Descriptor for Characteristic Presentation Format. More...

#include <BLE2904.hpp>

Inheritance diagram for BLE2904:
BLEDescriptor

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 BLEDescriptor
 BLEDescriptor (const char *uuid, uint16_t max_len=100)
 BLEDescriptor constructor.
 
 BLEDescriptor (BLEUUID uuid, uint16_t max_len=100)
 BLEDescriptor constructor.
 
virtual ~BLEDescriptor ()
 BLEDescriptor destructor.
 
uint16_t getHandle ()
 Get the BLE handle for this descriptor. More...
 
size_t getLength ()
 Get the length of the value of this descriptor. More...
 
BLEUUID getUUID ()
 Get the UUID of the descriptor.
 
uint8_t * getValue ()
 Get the value of this descriptor. More...
 
void handleGATTServerEvent (void *info)
 
void setAccessPermissions (ble_gatt_perm_t perm)
 
void setCallbacks (BLEDescriptorCallbacks *pCallbacks)
 Set the callback handlers for this descriptor. More...
 
void setValue (uint8_t *data, size_t size)
 Set the value of the descriptor. More...
 
void setValue (std::string value)
 Set the value of the descriptor. More...
 
std::string toString ()
 Return a string representation of the descriptor. More...
 

Static Public Attributes

static const uint8_t FORMAT_BOOLEAN = 1
 
static const uint8_t FORMAT_UINT2 = 2
 
static const uint8_t FORMAT_UINT4 = 3
 
static const uint8_t FORMAT_UINT8 = 4
 
static const uint8_t FORMAT_UINT12 = 5
 
static const uint8_t FORMAT_UINT16 = 6
 
static const uint8_t FORMAT_UINT24 = 7
 
static const uint8_t FORMAT_UINT32 = 8
 
static const uint8_t FORMAT_UINT48 = 9
 
static const uint8_t FORMAT_UINT64 = 10
 
static const uint8_t FORMAT_UINT128 = 11
 
static const uint8_t FORMAT_SINT8 = 12
 
static const uint8_t FORMAT_SINT12 = 13
 
static const uint8_t FORMAT_SINT16 = 14
 
static const uint8_t FORMAT_SINT24 = 15
 
static const uint8_t FORMAT_SINT32 = 16
 
static const uint8_t FORMAT_SINT48 = 17
 
static const uint8_t FORMAT_SINT64 = 18
 
static const uint8_t FORMAT_SINT128 = 19
 
static const uint8_t FORMAT_FLOAT32 = 20
 
static const uint8_t FORMAT_FLOAT64 = 21
 
static const uint8_t FORMAT_SFLOAT16 = 22
 
static const uint8_t FORMAT_SFLOAT32 = 23
 
static const uint8_t FORMAT_IEEE20601 = 24
 
static const uint8_t FORMAT_UTF8 = 25
 
static const uint8_t FORMAT_UTF16 = 26
 
static const uint8_t FORMAT_OPAQUE = 27
 

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 BLE2904::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.
85  {
86  m_data.m_unit = unit;
87  setValue((uint8_t*) &m_data, sizeof(m_data));
88 } // setUnit

The documentation for this class was generated from the following files:
BLEDescriptor::setValue
void setValue(uint8_t *data, size_t size)
Set the value of the descriptor.
Definition: BLEDescriptor.cpp:131