Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | List of all members
direct_bt::DBGattDesc Class Reference

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

#include <DBGattServer.hpp>

Inheritance diagram for direct_bt::DBGattDesc:
Collaboration diagram for direct_bt::DBGattDesc:

Public Member Functions

 DBGattDesc (const DBGattDesc &o)
 Copy constructor preserving the capacity of the value. More...
 
 DBGattDesc (DBGattDesc &&o) noexcept
 Move constructor. More...
 
 DBGattDesc (std::shared_ptr< const jau::uuid_t > type_, jau::POctets &&value_, bool variable_length_=false) noexcept
 
 ~DBGattDesc () noexcept override
 
void bzero () noexcept
 Fill value with zero bytes. More...
 
std::string get_java_class () const noexcept override
 
uint16_t getHandle () const noexcept
 Characteristic Descriptor Handle. More...
 
std::shared_ptr< const jau::uuid_tgetType () const noexcept
 Type of descriptor. More...
 
std::shared_ptr< const jau::uuid_t > & getType () noexcept
 Type of descriptor. More...
 
jau::POctetsgetValue () noexcept
 Get reference of this characteristic descriptor's value. More...
 
bool hasVariableLength () const noexcept
 True if value is of variable length, otherwise fixed length. More...
 
bool isClientCharConfig () const noexcept
 
bool isExtendedProperties () const noexcept
 Value is uint16_t bitfield. More...
 
bool isUserDescription () const noexcept
 
bool setValue (const uint8_t *source, const jau::nsize_t source_len, const jau::nsize_t dest_pos) noexcept
 Set this characteristic descriptor's value. More...
 
std::string toString () const noexcept override
 

Static Public Member Functions

static std::shared_ptr< DBGattDesccreateClientCharConfig ()
 Return a newly constructed Client Characteristic Configuration with a zero uint16_t value of fixed length. More...
 
static std::string java_class () noexcept
 

Detailed Description

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

A list of shared DBGattDesc instances are passed at DBGattChar construction and are retrievable via DBGattChar::getDescriptors().

See Direct-BT Overview.

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

Since
2.4.0

Definition at line 95 of file DBGattServer.hpp.

Constructor & Destructor Documentation

◆ ~DBGattDesc()

direct_bt::DBGattDesc::~DBGattDesc ( )
inlineoverridenoexcept

Definition at line 156 of file DBGattServer.hpp.

◆ DBGattDesc() [1/3]

direct_bt::DBGattDesc::DBGattDesc ( std::shared_ptr< const jau::uuid_t type_,
jau::POctets &&  value_,
bool  variable_length_ = false 
)
inlinenoexcept
Parameters
type_
value_the data, which length defines the maximum writable fixed length if variable_length is false. If variable length is true, its capacity limits the maximum writable length. Forced to false if isExtendedProperties() or isClientCharConfig().
variable_length_defaults to false.

Definition at line 168 of file DBGattServer.hpp.

◆ DBGattDesc() [2/3]

direct_bt::DBGattDesc::DBGattDesc ( const DBGattDesc o)
inline

Copy constructor preserving the capacity of the value.

Parameters
o

Definition at line 182 of file DBGattServer.hpp.

◆ DBGattDesc() [3/3]

direct_bt::DBGattDesc::DBGattDesc ( DBGattDesc &&  o)
inlinenoexcept

Move constructor.

Parameters
oPOctet source to be taken over

Definition at line 195 of file DBGattServer.hpp.

Member Function Documentation

◆ getHandle()

uint16_t direct_bt::DBGattDesc::getHandle ( ) const
inlinenoexcept

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 114 of file DBGattServer.hpp.

◆ getType() [1/2]

std::shared_ptr< const jau::uuid_t > & direct_bt::DBGattDesc::getType ( )
inlinenoexcept

Type of descriptor.

Definition at line 117 of file DBGattServer.hpp.

◆ getType() [2/2]

std::shared_ptr< const jau::uuid_t > direct_bt::DBGattDesc::getType ( ) const
inlinenoexcept

Type of descriptor.

Definition at line 120 of file DBGattServer.hpp.

◆ hasVariableLength()

bool direct_bt::DBGattDesc::hasVariableLength ( ) const
inlinenoexcept

True if value is of variable length, otherwise fixed length.

Definition at line 125 of file DBGattServer.hpp.

◆ getValue()

jau::POctets & direct_bt::DBGattDesc::getValue ( )
inlinenoexcept

Get reference of this characteristic descriptor's value.

Its capacity defines the maximum writable variable length and its size defines the maximum writable fixed length.

Definition at line 133 of file DBGattServer.hpp.

◆ setValue()

bool DBGattDesc::setValue ( const uint8_t *  source,
const jau::nsize_t  source_len,
const jau::nsize_t  dest_pos 
)
noexcept

Set this characteristic descriptor's value.

Methods won't exceed the value's capacity if it is of hasVariableLength() or the value's size otherwise.

Parameters
sourcedata to be written to this value
source_lenlength of the source data to be written
dest_posposition where the source data shall be written to the value
Returns
true if successful, otherwise false for exceeding the value's limits.

Definition at line 41 of file DBGattServer.cpp.

◆ java_class()

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

Definition at line 148 of file DBGattServer.hpp.

Here is the caller graph for this function:

◆ get_java_class()

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

Implements jau::jni::JavaUplink.

Definition at line 152 of file DBGattServer.hpp.

◆ createClientCharConfig()

static std::shared_ptr< DBGattDesc > direct_bt::DBGattDesc::createClientCharConfig ( )
inlinestatic

Return a newly constructed Client Characteristic Configuration with a zero uint16_t value of fixed length.

See also
isClientCharConfig()

Definition at line 208 of file DBGattServer.hpp.

◆ bzero()

void direct_bt::DBGattDesc::bzero ( )
inlinenoexcept

Fill value with zero bytes.

Definition at line 215 of file DBGattServer.hpp.

◆ isExtendedProperties()

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

Value is uint16_t bitfield.

Definition at line 220 of file DBGattServer.hpp.

Here is the caller graph for this function:

◆ isClientCharConfig()

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

Definition at line 223 of file DBGattServer.hpp.

Here is the caller graph for this function:

◆ isUserDescription()

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

Definition at line 226 of file DBGattServer.hpp.

◆ toString()

std::string direct_bt::DBGattDesc::toString ( ) const
inlineoverridevirtualnoexcept

Reimplemented from jau::jni::JavaUplink.

Definition at line 228 of file DBGattServer.hpp.


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