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::DBGattChar Class Reference

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

#include <DBGattServer.hpp>

Inheritance diagram for direct_bt::DBGattChar:
Collaboration diagram for direct_bt::DBGattChar:

Public Member Functions

 DBGattChar (const DBGattChar &o)
 Copy constructor preserving the capacity of the value. More...
 
 DBGattChar (DBGattChar &&o) noexcept
 Move constructor. More...
 
 DBGattChar (std::shared_ptr< const jau::uuid_t > value_type_, const BTGattChar::PropertyBitVal properties_, jau::darray< DBGattDescRef > &&descriptors_, jau::POctets &&value_, bool variable_length_=false) noexcept
 
 ~DBGattChar () noexcept override
 
void bzero () noexcept
 Fill value with zero bytes. More...
 
std::string get_java_class () const noexcept override
 
const DBGattDescRef getClientCharConfig () const noexcept
 
DBGattDescRef getClientCharConfig () noexcept
 
int getClientCharConfigIndex () const noexcept
 
jau::darray< DBGattDescRef > & getDescriptors () noexcept
 List of Characteristic Descriptions. More...
 
uint16_t getEndHandle () const noexcept
 Characteristic end handle, inclusive. More...
 
uint16_t getHandle () const noexcept
 Characteristic Handle of this instance. More...
 
BTGattChar::PropertyBitVal getProperties () const noexcept
 
const DBGattDescRef getUserDescription () const noexcept
 
DBGattDescRef getUserDescription () noexcept
 
int getUserDescriptionIndex () const noexcept
 
jau::POctetsgetValue () noexcept
 Get reference of this characteristics's value. More...
 
uint16_t getValueHandle () const noexcept
 Characteristics Value Handle. More...
 
std::shared_ptr< const jau::uuid_tgetValueType () const noexcept
 
std::shared_ptr< const jau::uuid_t > & getValueType () noexcept
 
bool hasProperties (const BTGattChar::PropertyBitVal v) const noexcept
 
bool hasVariableLength () const noexcept
 True if value is of variable length, otherwise fixed length. More...
 
bool setValue (const uint8_t *source, const jau::nsize_t source_len, const jau::nsize_t dest_pos) noexcept
 Set this characteristics's value. More...
 
std::string toString () const noexcept override
 

Static Public Member Functions

static std::string java_class () noexcept
 

Detailed Description

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

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

See Direct-BT Overview.

BT Core Spec v5.2: Vol 3, Part G GATT: 3.3 Characteristic Definition

handle -> CDAV value

BT Core Spec v5.2: Vol 3, Part G GATT: 4.6.1 Discover All Characteristics of a Service

The handle represents a service's characteristics-declaration and the value the Characteristics Property, Characteristics Value Handle and Characteristics UUID.

Since
2.4.0

Definition at line 264 of file DBGattServer.hpp.

Constructor & Destructor Documentation

◆ ~DBGattChar()

direct_bt::DBGattChar::~DBGattChar ( )
inlineoverridenoexcept

Definition at line 368 of file DBGattServer.hpp.

◆ DBGattChar() [1/3]

direct_bt::DBGattChar::DBGattChar ( std::shared_ptr< const jau::uuid_t value_type_,
const BTGattChar::PropertyBitVal  properties_,
jau::darray< DBGattDescRef > &&  descriptors_,
jau::POctets &&  value_,
bool  variable_length_ = false 
)
inlinenoexcept
Parameters
value_type_
properties_
descriptors_
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.
variable_length_defaults to false.

Definition at line 382 of file DBGattServer.hpp.

◆ DBGattChar() [2/3]

direct_bt::DBGattChar::DBGattChar ( const DBGattChar o)
inline

Copy constructor preserving the capacity of the value.

Parameters
o

Definition at line 411 of file DBGattServer.hpp.

◆ DBGattChar() [3/3]

direct_bt::DBGattChar::DBGattChar ( DBGattChar &&  o)
inlinenoexcept

Move constructor.

Parameters
oPOctet source to be taken over

Definition at line 429 of file DBGattServer.hpp.

Member Function Documentation

◆ getHandle()

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

Characteristic Handle of this instance.

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

◆ getEndHandle()

uint16_t direct_bt::DBGattChar::getEndHandle ( ) const
inlinenoexcept

Characteristic end handle, inclusive.

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

◆ getValueHandle()

uint16_t direct_bt::DBGattChar::getValueHandle ( ) const
inlinenoexcept

Characteristics Value 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 314 of file DBGattServer.hpp.

◆ getValueType() [1/2]

std::shared_ptr< const jau::uuid_t > & direct_bt::DBGattChar::getValueType ( )
inlinenoexcept

Definition at line 317 of file DBGattServer.hpp.

◆ getValueType() [2/2]

std::shared_ptr< const jau::uuid_t > direct_bt::DBGattChar::getValueType ( ) const
inlinenoexcept

Definition at line 320 of file DBGattServer.hpp.

◆ getProperties()

BTGattChar::PropertyBitVal direct_bt::DBGattChar::getProperties ( ) const
inlinenoexcept

Definition at line 323 of file DBGattServer.hpp.

◆ getDescriptors()

jau::darray< DBGattDescRef > & direct_bt::DBGattChar::getDescriptors ( )
inlinenoexcept

List of Characteristic Descriptions.

Definition at line 326 of file DBGattServer.hpp.

◆ hasVariableLength()

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

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

Definition at line 331 of file DBGattServer.hpp.

◆ getValue()

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

Get reference of this characteristics's value.

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

Definition at line 339 of file DBGattServer.hpp.

◆ setValue()

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

Set this characteristics'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 58 of file DBGattServer.cpp.

◆ getClientCharConfigIndex()

int direct_bt::DBGattChar::getClientCharConfigIndex ( ) const
inlinenoexcept

Definition at line 355 of file DBGattServer.hpp.

◆ getUserDescriptionIndex()

int direct_bt::DBGattChar::getUserDescriptionIndex ( ) const
inlinenoexcept

Definition at line 358 of file DBGattServer.hpp.

◆ java_class()

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

Definition at line 360 of file DBGattServer.hpp.

Here is the caller graph for this function:

◆ get_java_class()

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

Implements jau::jni::JavaUplink.

Definition at line 364 of file DBGattServer.hpp.

◆ hasProperties()

bool direct_bt::DBGattChar::hasProperties ( const BTGattChar::PropertyBitVal  v) const
inlinenoexcept

Definition at line 442 of file DBGattServer.hpp.

Here is the caller graph for this function:

◆ bzero()

void direct_bt::DBGattChar::bzero ( )
inlinenoexcept

Fill value with zero bytes.

Definition at line 445 of file DBGattServer.hpp.

◆ getClientCharConfig() [1/2]

const DBGattDescRef direct_bt::DBGattChar::getClientCharConfig ( ) const
inlinenoexcept

Definition at line 449 of file DBGattServer.hpp.

◆ getUserDescription() [1/2]

const DBGattDescRef direct_bt::DBGattChar::getUserDescription ( ) const
inlinenoexcept

Definition at line 456 of file DBGattServer.hpp.

Here is the caller graph for this function:

◆ getClientCharConfig() [2/2]

DBGattDescRef direct_bt::DBGattChar::getClientCharConfig ( )
inlinenoexcept

Definition at line 462 of file DBGattServer.hpp.

◆ getUserDescription() [2/2]

DBGattDescRef direct_bt::DBGattChar::getUserDescription ( )
inlinenoexcept

Definition at line 469 of file DBGattServer.hpp.

◆ toString()

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

Reimplemented from jau::jni::JavaUplink.

Definition at line 476 of file DBGattServer.hpp.


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