Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | List of all members
MyGATTServerListener Class Reference
Inheritance diagram for MyGATTServerListener:
Collaboration diagram for MyGATTServerListener:

Public Member Functions

 MyGATTServerListener ()
 
 ~MyGATTServerListener () noexcept override
 
void clientCharConfigChanged (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d, const bool notificationEnabled, const bool indicationEnabled) override
 Notifies a change of the Client Characteristic Configuration Descriptor (CCCD) value. More...
 
void close () noexcept
 
void connected (const BTDeviceRef &device, const uint16_t initialMTU) override
 Notification that device got connected. More...
 
void disconnected (const BTDeviceRef &device) override
 Notification that device got disconnected. More...
 
void mtuChanged (const BTDeviceRef &device, const uint16_t mtu) override
 Notification that the MTU has changed. More...
 
bool readCharValue (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c) override
 Signals attempt to read a value. More...
 
bool readDescValue (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d) override
 Signals attempt to read a value. More...
 
bool writeCharValue (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const jau::TROOctets &value, const uint16_t value_offset) override
 Signals attempt to write a single or bulk (prepare) value. More...
 
void writeCharValueDone (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c) override
 Notifies completion of single or bulk writeCharValue() after having accepted and performed all write requests. More...
 
bool writeDescValue (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d, const jau::TROOctets &value, const uint16_t value_offset) override
 Signals attempt to write a single or bulk (prepare) value. More...
 
void writeDescValueDone (const BTDeviceRef &device, const DBGattServiceRef &s, const DBGattCharRef &c, const DBGattDescRef &d) override
 Notifies completion of single or bulk writeCharValue() after having accepted and performed all write requests. More...
 
- Public Member Functions inherited from direct_bt::DBGattServer::Listener
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

Examples
dbt_peripheral00.cpp.

Definition at line 335 of file dbt_peripheral00.cpp.

Constructor & Destructor Documentation

◆ MyGATTServerListener()

MyGATTServerListener::MyGATTServerListener ( )
inline
Examples
dbt_peripheral00.cpp.

Definition at line 411 of file dbt_peripheral00.cpp.

◆ ~MyGATTServerListener()

MyGATTServerListener::~MyGATTServerListener ( )
inlineoverridenoexcept
Examples
dbt_peripheral00.cpp.

Definition at line 420 of file dbt_peripheral00.cpp.

Member Function Documentation

◆ close()

void MyGATTServerListener::close ( )
inlinenoexcept
Examples
dbt_peripheral00.cpp.

Definition at line 424 of file dbt_peripheral00.cpp.

◆ connected()

void MyGATTServerListener::connected ( const BTDeviceRef device,
const uint16_t  initialMTU 
)
inlineoverridevirtual

Notification that device got connected.

Convenient user entry, allowing to setup resources.

Parameters
devicethe connected device
initialMTUinitial used minimum MTU until negotiated.

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 429 of file dbt_peripheral00.cpp.

◆ disconnected()

void MyGATTServerListener::disconnected ( const BTDeviceRef device)
inlineoverridevirtual

Notification that device got disconnected.

Convenient user entry, allowing to clean up resources.

Parameters
devicethe disconnected device.

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 439 of file dbt_peripheral00.cpp.

◆ mtuChanged()

void MyGATTServerListener::mtuChanged ( const BTDeviceRef device,
const uint16_t  mtu 
)
inlineoverridevirtual

Notification that the MTU has changed.

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

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 448 of file dbt_peripheral00.cpp.

◆ readCharValue()

bool MyGATTServerListener::readCharValue ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c 
)
inlineoverridevirtual

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.

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 457 of file dbt_peripheral00.cpp.

◆ readDescValue()

bool MyGATTServerListener::readDescValue ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const DBGattDescRef d 
)
inlineoverridevirtual

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.

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 464 of file dbt_peripheral00.cpp.

◆ writeCharValue()

bool MyGATTServerListener::writeCharValue ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const jau::TROOctets value,
const uint16_t  value_offset 
)
inlineoverridevirtual

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()

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 471 of file dbt_peripheral00.cpp.

◆ writeCharValueDone()

void MyGATTServerListener::writeCharValueDone ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c 
)
inlineoverridevirtual

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

Parameters
device
s
c
See also
writeCharValue()

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 479 of file dbt_peripheral00.cpp.

◆ writeDescValue()

bool MyGATTServerListener::writeDescValue ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const DBGattDescRef d,
const jau::TROOctets value,
const uint16_t  value_offset 
)
inlineoverridevirtual

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()

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 495 of file dbt_peripheral00.cpp.

◆ writeDescValueDone()

void MyGATTServerListener::writeDescValueDone ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const DBGattDescRef d 
)
inlineoverridevirtual

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

Parameters
device
s
c
d
See also
writeDescValue()

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 503 of file dbt_peripheral00.cpp.

◆ clientCharConfigChanged()

void MyGATTServerListener::clientCharConfigChanged ( const BTDeviceRef device,
const DBGattServiceRef s,
const DBGattCharRef c,
const DBGattDescRef d,
const bool  notificationEnabled,
const bool  indicationEnabled 
)
inlineoverridevirtual

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

Parameters
device
s
c
d
notificationEnabled
indicationEnabled

Implements direct_bt::DBGattServer::Listener.

Examples
dbt_peripheral00.cpp.

Definition at line 510 of file dbt_peripheral00.cpp.


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