Direct-BT v3.3.0-1-gc2d430c
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

Representing a Gatt Characteristic Descriptor object from the GATTRole::Client perspective. More...

#include <BTGattDesc.hpp>

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

Public Types

enum  Type : uint16_t {
  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 jau::uuid_t > &&type_, const uint16_t handle_) noexcept
 
std::string get_java_class () const noexcept override
 
std::shared_ptr< BTDevicegetDeviceUnchecked () const noexcept
 
std::shared_ptr< BTGattChargetGattCharChecked () const
 
std::shared_ptr< BTGattChargetGattCharUnchecked () const noexcept
 
std::shared_ptr< BTGattHandlergetGattHandlerUnchecked () const noexcept
 
bool isClientCharConfig () const noexcept
 
bool isExtendedProperties () const noexcept
 Value is uint16_t bitfield. More...
 
bool isUserDescription () const noexcept
 
bool readValue (int expectedLength=-1) noexcept
 BT Core Spec v5.2: Vol 3, Part G GATT: 4.12.1 Read Characteristic Descriptor. More...
 
std::string toString () const noexcept override
 
bool writeValue () noexcept
 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
 ~BTObject () noexcept override
 
void checkValidInstance () const override
 Throws an IllegalStateException if instance is not valid. More...
 
bool isValidInstance () const noexcept
 Returns whether the object's reference is valid and in a general operational state. More...
 
std::string toString () const noexcept override
 

Static Public Member Functions

static std::string java_class () noexcept
 

Public Attributes

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

Static Public Attributes

static const std::shared_ptr< jau::uuid_tTYPE_CCC_DESC
 
static const std::shared_ptr< jau::uuid_tTYPE_EXT_PROP
 
static const std::shared_ptr< jau::uuid_tTYPE_USER_DESC
 

Additional Inherited Members

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

Detailed Description

Representing a Gatt Characteristic Descriptor object from the GATTRole::Client perspective.

A list of shared BTGattDesc instances is available from BTGattChar via BTGattChar::descriptorList.

See Direct-BT Overview.

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

Examples
dbt_scanner10.cpp.

Definition at line 74 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.

See GattAttributeType for further non BTGattDesc related declarations.

Enumerator
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 92 of file BTGattDesc.hpp.

Constructor & Destructor Documentation

◆ BTGattDesc()

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

Definition at line 123 of file BTGattDesc.hpp.

Member Function Documentation

◆ get_java_class()

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

Implements jau::jni::JavaUplink.

Definition at line 129 of file BTGattDesc.hpp.

◆ java_class()

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

Definition at line 132 of file BTGattDesc.hpp.

Here is the caller graph for this function:

◆ getGattCharUnchecked()

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

Definition at line 136 of file BTGattDesc.hpp.

Here is the caller graph for this function:

◆ getGattCharChecked()

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

Definition at line 47 of file BTGattDesc.cpp.

◆ getGattHandlerUnchecked()

std::shared_ptr< BTGattHandler > BTGattDesc::getGattHandlerUnchecked ( ) const
noexcept

Definition at line 55 of file BTGattDesc.cpp.

◆ getDeviceUnchecked()

std::shared_ptr< BTDevice > BTGattDesc::getDeviceUnchecked ( ) const
noexcept

Definition at line 63 of file BTGattDesc.cpp.

Here is the caller graph for this function:

◆ toString()

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

Reimplemented from jau::jni::JavaUplink.

Examples
dbt_scanner10.cpp.

Definition at line 99 of file BTGattDesc.cpp.

Here is the caller graph for this function:

◆ isExtendedProperties()

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

Value is uint16_t bitfield.

Definition at line 144 of file BTGattDesc.hpp.

◆ isClientCharConfig()

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

Definition at line 147 of file BTGattDesc.hpp.

◆ isUserDescription()

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

Definition at line 150 of file BTGattDesc.hpp.

◆ readValue()

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

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, false is returned.

Definition at line 71 of file BTGattDesc.cpp.

◆ writeValue()

bool BTGattDesc::writeValue ( )
noexcept

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, false is returned.

Definition at line 85 of file BTGattDesc.cpp.

Member Data Documentation

◆ TYPE_EXT_PROP

const std::shared_ptr< jau::uuid_t > BTGattDesc::TYPE_EXT_PROP
static

Definition at line 82 of file BTGattDesc.hpp.

◆ TYPE_USER_DESC

const std::shared_ptr< jau::uuid_t > BTGattDesc::TYPE_USER_DESC
static

Definition at line 83 of file BTGattDesc.hpp.

◆ TYPE_CCC_DESC

const std::shared_ptr< jau::uuid_t > BTGattDesc::TYPE_CCC_DESC
static

Definition at line 84 of file BTGattDesc.hpp.

◆ type

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

Type of descriptor.

Examples
dbt_scanner10.cpp.

Definition at line 110 of file BTGattDesc.hpp.

◆ 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 118 of file BTGattDesc.hpp.

◆ value

jau::POctets direct_bt::BTGattDesc::value

Definition at line 121 of file BTGattDesc.hpp.


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