Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
direct_bt::BTGattDesc Class Reference

BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3 Characteristic Descriptor. More...

#include <BTGattDesc.hpp>

Inheritance diagram for direct_bt::BTGattDesc:
Collaboration diagram for direct_bt::BTGattDesc:

Public Types

enum  Type : uint16_t {
  CHARACTERISTIC_APPEARANCE = 0x2A01, CHARACTERISTIC_PERIPHERAL_PRIV_FLAG = 0x2A02, CHARACTERISTIC_RECONNECTION_ADDRESS = 0x2A03, CHARACTERISTIC_PERIPHERAL_PREF_CONN = 0x2A04,
  CHARACTERISTIC_SERVICE_CHANGED = 0x2A05, CHARACTERISTIC_EXTENDED_PROPERTIES = 0x2900, CHARACTERISTIC_USER_DESCRIPTION = 0x2901, CLIENT_CHARACTERISTIC_CONFIGURATION = 0x2902,
  SERVER_CHARACTERISTIC_CONFIGURATION = 0x2903, CHARACTERISTIC_PRESENTATION_FORMAT = 0x2904, CHARACTERISTIC_AGGREGATE_FORMAT = 0x2905, CUSTOM_CHARACTERISTIC_DESCRIPTION = 0x8888
}
 Following UUID16 GATT profile attribute types are listed under: BT Core Spec v5.2: Vol 3, Part G GATT: 3.4 Summary of GATT Profile Attribute Types. More...
 

Public Member Functions

 BTGattDesc (const BTGattCharRef &characteristic, std::unique_ptr< const uuid_t > &&type_, const uint16_t handle_) noexcept
 
std::string get_java_class () const noexcept override
 
std::shared_ptr< BTGattChargetGattCharUnchecked () const noexcept
 
std::shared_ptr< BTGattChargetGattCharChecked () const
 
std::shared_ptr< BTGattHandlergetGattHandlerChecked () const
 
std::shared_ptr< BTDevicegetDeviceChecked () const
 
virtual std::string toString () const noexcept override
 
bool isExtendedProperties () const noexcept
 Value is uint16_t bitfield. More...
 
bool isClientCharConfig () const noexcept
 
bool readValue (int expectedLength=-1)
 BT Core Spec v5.2: Vol 3, Part G GATT: 4.12.1 Read Characteristic Descriptor. More...
 
bool writeValue ()
 BT Core Spec v5.2: Vol 3, Part G GATT: 4.12.3 Write Characteristic Descriptors. More...
 
- Public Member Functions inherited from direct_bt::BTObject
virtual ~BTObject () noexcept
 
bool isValid () const noexcept
 Returns whether the object's reference is valid and in a general operational state. More...
 

Static Public Member Functions

static std::string java_class () noexcept
 

Public Attributes

std::unique_ptr< const uuid_ttype
 Type of descriptor. More...
 
const uint16_t handle
 Characteristic Descriptor Handle. More...
 
POctets value
 

Static Public Attributes

static const uuid16_t TYPE_EXT_PROP
 
static const uuid16_t TYPE_USER_DESC
 
static const uuid16_t TYPE_CCC_DESC
 

Additional Inherited Members

- Protected Member Functions inherited from direct_bt::BTObject
 BTObject () noexcept
 
- Protected Attributes inherited from direct_bt::BTObject
std::atomic_bool valid
 

Detailed Description

BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3 Characteristic Descriptor.

Examples
dbt_scanner10.cpp.

Definition at line 62 of file BTGattDesc.hpp.

Member Enumeration Documentation

◆ Type

enum direct_bt::BTGattDesc::Type : uint16_t

Following UUID16 GATT profile attribute types are listed under: BT Core Spec v5.2: Vol 3, Part G GATT: 3.4 Summary of GATT Profile Attribute Types.

Enumerator
CHARACTERISTIC_APPEARANCE 
CHARACTERISTIC_PERIPHERAL_PRIV_FLAG 
CHARACTERISTIC_RECONNECTION_ADDRESS 
CHARACTERISTIC_PERIPHERAL_PREF_CONN 
CHARACTERISTIC_SERVICE_CHANGED 
CHARACTERISTIC_EXTENDED_PROPERTIES 
CHARACTERISTIC_USER_DESCRIPTION 
CLIENT_CHARACTERISTIC_CONFIGURATION 
SERVER_CHARACTERISTIC_CONFIGURATION 
CHARACTERISTIC_PRESENTATION_FORMAT 
CHARACTERISTIC_AGGREGATE_FORMAT 
CUSTOM_CHARACTERISTIC_DESCRIPTION 

Our identifier to mark a custom vendor Characteristic Descriptor.

Definition at line 78 of file BTGattDesc.hpp.

Constructor & Destructor Documentation

◆ BTGattDesc()

direct_bt::BTGattDesc::BTGattDesc ( const BTGattCharRef characteristic,
std::unique_ptr< const uuid_t > &&  type_,
const uint16_t  handle_ 
)
inlinenoexcept

Definition at line 115 of file BTGattDesc.hpp.

Member Function Documentation

◆ get_java_class()

std::string direct_bt::BTGattDesc::get_java_class ( ) const
inlineoverridevirtualnoexcept

Implements jau::JavaUplink.

Definition at line 119 of file BTGattDesc.hpp.

Here is the call graph for this function:

◆ getDeviceChecked()

std::shared_ptr< BTDevice > BTGattDesc::getDeviceChecked ( ) const

Definition at line 60 of file BTGattDesc.cpp.

◆ getGattCharChecked()

std::shared_ptr< BTGattChar > BTGattDesc::getGattCharChecked ( ) const

Definition at line 48 of file BTGattDesc.cpp.

Here is the caller graph for this function:

◆ getGattCharUnchecked()

std::shared_ptr<BTGattChar> direct_bt::BTGattDesc::getGattCharUnchecked ( ) const
inlinenoexcept

Definition at line 126 of file BTGattDesc.hpp.

◆ getGattHandlerChecked()

std::shared_ptr< BTGattHandler > BTGattDesc::getGattHandlerChecked ( ) const

Definition at line 56 of file BTGattDesc.cpp.

◆ isClientCharConfig()

bool direct_bt::BTGattDesc::isClientCharConfig ( ) const
inlinenoexcept

Definition at line 137 of file BTGattDesc.hpp.

Here is the caller graph for this function:

◆ isExtendedProperties()

bool direct_bt::BTGattDesc::isExtendedProperties ( ) const
inlinenoexcept

Value is uint16_t bitfield.

Definition at line 134 of file BTGattDesc.hpp.

◆ java_class()

static std::string direct_bt::BTGattDesc::java_class ( )
inlinestaticnoexcept

Definition at line 122 of file BTGattDesc.hpp.

Here is the caller graph for this function:

◆ readValue()

bool BTGattDesc::readValue ( int  expectedLength = -1)

BT Core Spec v5.2: Vol 3, Part G GATT: 4.12.1 Read Characteristic Descriptor.

BT Core Spec v5.2: Vol 3, Part G GATT: 4.12.2 Read Long Characteristic Descriptor

If expectedLength = 0, then only one ATT_READ_REQ/RSP will be used.

If expectedLength < 0, then long values using multiple ATT_READ_BLOB_REQ/RSP will be used until the response returns zero. This is the default parameter.

If expectedLength > 0, then long values using multiple ATT_READ_BLOB_REQ/RSP will be used if required until the response returns zero.

Convenience delegation call to BTGattHandler via BTDevice If the BTDevice's BTGattHandler is null, i.e. not connected, an IllegalStateException is thrown.

Definition at line 64 of file BTGattDesc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

std::string BTGattDesc::toString ( ) const
overridevirtualnoexcept

Reimplemented from direct_bt::BTObject.

Examples
dbt_scanner10.cpp.

Definition at line 82 of file BTGattDesc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeValue()

bool BTGattDesc::writeValue ( )

BT Core Spec v5.2: Vol 3, Part G GATT: 4.12.3 Write Characteristic Descriptors.

BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3 Characteristic Descriptor

BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration

Convenience delegation call to BTGattHandler via BTDevice If the BTDevice's BTGattHandler is null, i.e. not connected, an IllegalStateException is thrown.

Definition at line 73 of file BTGattDesc.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ handle

const uint16_t direct_bt::BTGattDesc::handle

Characteristic Descriptor Handle.

Attribute handles are unique for each device (server) (BT Core Spec v5.2: Vol 3, Part F Protocol..: 3.2.2 Attribute Handle).

Definition at line 110 of file BTGattDesc.hpp.

◆ type

std::unique_ptr<const uuid_t> direct_bt::BTGattDesc::type

Type of descriptor.

Examples
dbt_scanner10.cpp.

Definition at line 102 of file BTGattDesc.hpp.

◆ TYPE_CCC_DESC

const uuid16_t BTGattDesc::TYPE_CCC_DESC
static

Definition at line 72 of file BTGattDesc.hpp.

◆ TYPE_EXT_PROP

const uuid16_t BTGattDesc::TYPE_EXT_PROP
static

Definition at line 70 of file BTGattDesc.hpp.

◆ TYPE_USER_DESC

const uuid16_t BTGattDesc::TYPE_USER_DESC
static

Definition at line 71 of file BTGattDesc.hpp.

◆ value

POctets direct_bt::BTGattDesc::value

Definition at line 113 of file BTGattDesc.hpp.


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