Direct-BT v3.2.3-1-g688f983
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | List of all members
direct_bt::BTGattCharListener Class Referenceabstract

BTGattChar event listener for notification and indication events. More...

#include <BTGattChar.hpp>

Inheritance diagram for direct_bt::BTGattCharListener:
Collaboration diagram for direct_bt::BTGattCharListener:

Public Member Functions

 ~BTGattCharListener () noexcept override=default
 
std::string get_java_class () const noexcept override
 
virtual void indicationReceived (BTGattCharRef charDecl, const jau::TROOctets &charValue, const uint64_t timestamp, const bool confirmationSent)=0
 Called from native BLE stack, initiated by a received indication associated with the given BTGattChar. More...
 
virtual void notificationReceived (BTGattCharRef charDecl, const jau::TROOctets &charValue, const uint64_t timestamp)=0
 Called from native BLE stack, initiated by a received notification associated with the given BTGattChar. More...
 
bool operator!= (const BTGattCharListener &rhs) const noexcept
 
virtual bool operator== (const BTGattCharListener &rhs) const noexcept
 Default comparison operator, merely testing for same memory reference. More...
 
std::string toString () const noexcept override
 Return a simple description about this instance. More...
 
virtual const char * type_name () const noexcept
 Returns a unique string denominating the type of this instance. More...
 

Static Public Member Functions

static std::string java_class () noexcept
 

Detailed Description

BTGattChar event listener for notification and indication events.

A listener instance may be attached to a BTGattChar instance via BTGattChar::addCharListener(BTGattCharListenerRef) to listen to its events.

A listener instance may be attached to a BTGattHandler via BTGattHandler::addCharListener(BTGattCharListenerRef) to listen to all events of the device or the matching filtered events.

The listener manager maintains a unique set of listener instances without duplicates.

Examples
dbt_scanner10.cpp.

Definition at line 450 of file BTGattChar.hpp.

Constructor & Destructor Documentation

◆ ~BTGattCharListener()

direct_bt::BTGattCharListener::~BTGattCharListener ( )
overridedefaultnoexcept

Member Function Documentation

◆ type_name()

const char * BTGattCharListener::type_name ( ) const
virtualnoexcept

Returns a unique string denominating the type of this instance.

Simple access and provision of a typename string representation at compile time like RTTI via jau::type_name_cue.

Definition at line 52 of file BTGattChar.cpp.

◆ notificationReceived()

virtual void direct_bt::BTGattCharListener::notificationReceived ( BTGattCharRef  charDecl,
const jau::TROOctets charValue,
const uint64_t  timestamp 
)
pure virtual

Called from native BLE stack, initiated by a received notification associated with the given BTGattChar.

Parameters
charDeclBTGattChar related to this notification
charValuethe notification value
timestampmonotonic timestamp at reception, see jau::getCurrentMilliseconds()

Implemented in JNIGattCharListener, MyGATTEventListener, and MyGATTEventListener.

◆ indicationReceived()

virtual void direct_bt::BTGattCharListener::indicationReceived ( BTGattCharRef  charDecl,
const jau::TROOctets charValue,
const uint64_t  timestamp,
const bool  confirmationSent 
)
pure virtual

Called from native BLE stack, initiated by a received indication associated with the given BTGattChar.

Parameters
charDeclBTGattChar related to this indication
charValuethe indication value
timestampmonotonic timestamp at reception, see jau::getCurrentMilliseconds()
confirmationSentif true, the native stack has sent the confirmation, otherwise user is required to do so.

Implemented in JNIGattCharListener, MyGATTEventListener, and MyGATTEventListener.

◆ toString()

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

Return a simple description about this instance.

Reimplemented from jau::jni::JavaUplink.

Definition at line 485 of file BTGattChar.hpp.

◆ get_java_class()

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

Implements jau::jni::JavaUplink.

Definition at line 489 of file BTGattChar.hpp.

◆ java_class()

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

Definition at line 492 of file BTGattChar.hpp.

◆ operator==()

virtual bool direct_bt::BTGattCharListener::operator== ( const BTGattCharListener rhs) const
inlinevirtualnoexcept

Default comparison operator, merely testing for same memory reference.

Specializations may override.

Definition at line 502 of file BTGattChar.hpp.

◆ operator!=()

bool direct_bt::BTGattCharListener::operator!= ( const BTGattCharListener rhs) const
inlinenoexcept

Definition at line 505 of file BTGattChar.hpp.


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