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

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

#include <BTGattService.hpp>

Inheritance diagram for direct_bt::BTGattService:
Collaboration diagram for direct_bt::BTGattService:

Public Member Functions

 BTGattService (const std::shared_ptr< BTGattHandler > &handler_, const bool isPrimary_, const uint16_t startHandle_, const uint16_t endHandle_, std::unique_ptr< const jau::uuid_t > &&type_) noexcept
 
BTGattCharRef findGattChar (const BTGattChar &characteristic) noexcept
 Find a BTGattChar by itself, i.e. More...
 
BTGattCharRef findGattChar (const jau::uuid_t &char_uuid) noexcept
 Find a BTGattChar by its char_uuid. More...
 
std::string get_java_class () const noexcept override
 
BTDeviceRef getDeviceChecked () const
 
BTDeviceRef getDeviceUnchecked () const noexcept
 
BTGattHandlerRef getGattHandlerChecked () const
 
BTGattHandlerRef getGattHandlerUnchecked () const noexcept
 
std::string toString () const noexcept override
 
- 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

jau::darray< BTGattCharRefcharacteristicList
 List of Characteristic Declarations as shared reference. More...
 
const uint16_t end_handle
 Service end handle, inclusive. More...
 
const uint16_t handle
 Service start handle. More...
 
const bool primary
 
std::unique_ptr< const jau::uuid_ttype
 Service type UUID. More...
 

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 Service object from the GATTRole::Client perspective.

A list of shared BTGattService instances can be retrieved from BTDevice after successful connection and optional pairing via BTDevice::getGattServices().

See Direct-BT Overview.

BT Core Spec v5.2: Vol 3, Part G GATT: 3.1 Service Definition

Includes a complete [Primary] Service Declaration including its list of Characteristic Declarations, which also may include its client config if available.

Examples
dbt_scanner10.cpp.

Definition at line 84 of file BTGattService.hpp.

Constructor & Destructor Documentation

◆ BTGattService()

direct_bt::BTGattService::BTGattService ( const std::shared_ptr< BTGattHandler > &  handler_,
const bool  isPrimary_,
const uint16_t  startHandle_,
const uint16_t  endHandle_,
std::unique_ptr< const jau::uuid_t > &&  type_ 
)
inlinenoexcept

Definition at line 116 of file BTGattService.hpp.

Member Function Documentation

◆ get_java_class()

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

Implements jau::jni::JavaUplink.

Definition at line 122 of file BTGattService.hpp.

◆ java_class()

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

Definition at line 125 of file BTGattService.hpp.

Here is the caller graph for this function:

◆ getGattHandlerUnchecked()

BTGattHandlerRef direct_bt::BTGattService::getGattHandlerUnchecked ( ) const
inlinenoexcept

Definition at line 129 of file BTGattService.hpp.

Here is the caller graph for this function:

◆ getGattHandlerChecked()

BTGattHandlerRef BTGattService::getGattHandlerChecked ( ) const

Definition at line 46 of file BTGattService.cpp.

Here is the caller graph for this function:

◆ getDeviceUnchecked()

BTDeviceRef BTGattService::getDeviceUnchecked ( ) const
noexcept

Definition at line 54 of file BTGattService.cpp.

◆ getDeviceChecked()

BTDeviceRef BTGattService::getDeviceChecked ( ) const

Definition at line 62 of file BTGattService.cpp.

◆ findGattChar() [1/2]

BTGattCharRef BTGattService::findGattChar ( const jau::uuid_t char_uuid)
noexcept

Find a BTGattChar by its char_uuid.

@parameter char_uuid the jau::uuid_t of the desired BTGattChar, within this BTGattService.

Returns
The matching characteristic or null if not found

Definition at line 66 of file BTGattService.cpp.

◆ findGattChar() [2/2]

BTGattCharRef BTGattService::findGattChar ( const BTGattChar characteristic)
noexcept

Find a BTGattChar by itself, i.e.

mapping BTGattChar instance to BTGattCharRef.

@parameter characteristic the desired BTGattChar, within this BTGattService.

Returns
The matching characteristic or null if not found

Definition at line 75 of file BTGattService.cpp.

◆ toString()

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

Reimplemented from jau::jni::JavaUplink.

Examples
dbt_scanner10.cpp.

Definition at line 84 of file BTGattService.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ primary

const bool direct_bt::BTGattService::primary

Definition at line 92 of file BTGattService.hpp.

◆ handle

const uint16_t direct_bt::BTGattService::handle

Service start 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 100 of file BTGattService.hpp.

◆ end_handle

const uint16_t direct_bt::BTGattService::end_handle

Service 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 108 of file BTGattService.hpp.

◆ type

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

Service type UUID.

Examples
dbt_scanner10.cpp.

Definition at line 111 of file BTGattService.hpp.

◆ characteristicList

jau::darray<BTGattCharRef> direct_bt::BTGattService::characteristicList

List of Characteristic Declarations as shared reference.

Examples
dbt_scanner10.cpp.

Definition at line 114 of file BTGattService.hpp.


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