Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | List of all members
direct_bt::DBGattServer::Listener Class Referenceabstract

Listener to remote master device's operations on the local GATT-Server. More...

#include <DBGattServer.hpp>

Inheritance diagram for direct_bt::DBGattServer::Listener:
Collaboration diagram for direct_bt::DBGattServer::Listener:

Public Member Functions

virtual ~Listener ()=default
 
virtual void clientCharConfigChanged (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d, const bool notificationEnabled, const bool indicationEnabled)=0
 Notifies a change of the Client Characteristic Configuration Descriptor (CCCD) value. More...
 
virtual void connected (const BTDeviceRef &device, const uint16_t initialMTU)=0
 Notification that device got connected. More...
 
virtual void disconnected (const BTDeviceRef &device)=0
 Notification that device got disconnected. More...
 
virtual void mtuChanged (const BTDeviceRef &device, const uint16_t mtu)=0
 Notification that the MTU has changed. More...
 
bool operator!= (const Listener &rhs) const
 
virtual bool operator== (const Listener &rhs) const
 Default comparison operator, merely testing for same memory reference. More...
 
virtual bool readCharValue (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c)=0
 Signals attempt to read a value. More...
 
virtual bool readDescValue (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d)=0
 Signals attempt to read a value. More...
 
virtual bool writeCharValue (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const jau::TROOctets &value, const uint16_t value_offset)=0
 Signals attempt to write a single or bulk (prepare) value. More...
 
virtual void writeCharValueDone (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c)=0
 Notifies completion of single or bulk writeCharValue() after having accepted and performed all write requests. More...
 
virtual bool writeDescValue (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d, const jau::TROOctets &value, const uint16_t value_offset)=0
 Signals attempt to write a single or bulk (prepare) value. More...
 
virtual void writeDescValueDone (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d)=0
 Notifies completion of single or bulk writeCharValue() after having accepted and performed all write requests. More...
 

Detailed Description

Listener to remote master device's operations on the local GATT-Server.

All methods shall return as soon as possible to not block GATT event processing.

Examples
dbt_peripheral00.cpp.

Definition at line 727 of file DBGattServer.hpp.

Constructor & Destructor Documentation

◆ ~Listener()

virtual direct_bt::DBGattServer::Listener::~Listener ( )
virtualdefault

Member Function Documentation

◆ connected()

virtual void direct_bt::DBGattServer::Listener::connected ( const BTDeviceRef device,
const uint16_t  initialMTU 
)
pure virtual

Notification that device got connected.

Convenient user entry, allowing to setup resources.

Parameters
devicethe connected device
initialMTUinitial used minimum MTU until negotiated.

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ disconnected()

virtual void direct_bt::DBGattServer::Listener::disconnected ( const BTDeviceRef device)
pure virtual

Notification that device got disconnected.

Convenient user entry, allowing to clean up resources.

Parameters
devicethe disconnected device.

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ mtuChanged()

virtual void direct_bt::DBGattServer::Listener::mtuChanged ( const BTDeviceRef device,
const uint16_t  mtu 
)
pure virtual

Notification that the MTU has changed.

Parameters
devicethe device for which the MTU has changed
mtuthe new negotiated MTU

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ readCharValue()

virtual bool direct_bt::DBGattServer::Listener::readCharValue ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c 
)
pure virtual

Signals attempt to read a value.

Callee shall accept the read request by returning true, otherwise false.

Parameters
device
s
c
Returns
true if master read has been accepted by GATT-Server listener, otherwise false. Only if all listener return true, the read action will be allowed.

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ readDescValue()

virtual bool direct_bt::DBGattServer::Listener::readDescValue ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const DBGattDescRef d 
)
pure virtual

Signals attempt to read a value.

Callee shall accept the read request by returning true, otherwise false.

Parameters
device
s
c
d
Returns
true if master read has been accepted by GATT-Server listener, otherwise false. Only if all listener return true, the read action will be allowed.

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ writeCharValue()

virtual bool direct_bt::DBGattServer::Listener::writeCharValue ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const jau::TROOctets value,
const uint16_t  value_offset 
)
pure virtual

Signals attempt to write a single or bulk (prepare) value.

Callee shall accept the write request by returning true, otherwise false.

Parameters
device
s
c
value
value_offset
Returns
true if master write has been accepted by GATT-Server listener, otherwise false. Only if all listener return true, the write action will be allowed.
See also
writeCharValueDone()

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ writeCharValueDone()

virtual void direct_bt::DBGattServer::Listener::writeCharValueDone ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c 
)
pure virtual

Notifies completion of single or bulk writeCharValue() after having accepted and performed all write requests.

Parameters
device
s
c
See also
writeCharValue()

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ writeDescValue()

virtual bool direct_bt::DBGattServer::Listener::writeDescValue ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const DBGattDescRef d,
const jau::TROOctets value,
const uint16_t  value_offset 
)
pure virtual

Signals attempt to write a single or bulk (prepare) value.

Callee shall accept the write request by returning true, otherwise false.

Parameters
device
s
c
d
value
value_offset
Returns
true if master write has been accepted by GATT-Server listener, otherwise false. Only if all listener return true, the write action will be allowed.
See also
writeDescValueDone()

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ writeDescValueDone()

virtual void direct_bt::DBGattServer::Listener::writeDescValueDone ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const DBGattDescRef d 
)
pure virtual

Notifies completion of single or bulk writeCharValue() after having accepted and performed all write requests.

Parameters
device
s
c
d
See also
writeDescValue()

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ clientCharConfigChanged()

virtual void direct_bt::DBGattServer::Listener::clientCharConfigChanged ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const DBGattDescRef d,
const bool  notificationEnabled,
const bool  indicationEnabled 
)
pure virtual

Notifies a change of the Client Characteristic Configuration Descriptor (CCCD) value.

Parameters
device
s
c
d
notificationEnabled
indicationEnabled

Implemented in MyGATTServerListener, and JNIDBGattServerListener.

◆ operator==()

virtual bool direct_bt::DBGattServer::Listener::operator== ( const Listener rhs) const
inlinevirtual

Default comparison operator, merely testing for same memory reference.

Specializations may override.

Definition at line 856 of file DBGattServer.hpp.

◆ operator!=()

bool direct_bt::DBGattServer::Listener::operator!= ( const Listener rhs) const
inline

Definition at line 859 of file DBGattServer.hpp.


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