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

Public Member Functions

 NativeGattToServerCharListener ()=default
 
BTDeviceRef getToClient () noexcept
 
void indicationReceived (const BTDeviceRef &source, const uint16_t char_handle, const TROOctets &char_value, const uint64_t timestamp, const bool confirmationSent) override
 Called from native BLE stack, initiated by a received indication. More...
 
void mtuResponse (const uint16_t clientMTU, const AttPDUMsg &pduReply, const AttErrorRsp::ErrorCode error_reply, const uint16_t serverMTU, const uint16_t usedMTU, const BTDeviceRef &serverReplier, const BTDeviceRef &clientRequester) override
 Informal notification about a complete MTU exchange request and response to and from this GATTRole::Server, optional. More...
 
void notificationReceived (const BTDeviceRef &source, const uint16_t char_handle, const TROOctets &char_value, const uint64_t timestamp) override
 Called from native BLE stack, initiated by a received notification. More...
 
void readResponse (const uint16_t handle, const uint16_t value_offset, const AttPDUMsg &pduReply, const AttErrorRsp::ErrorCode error_reply, const jau::TROOctets &data_reply, const BTDeviceRef &serverReplier, const BTDeviceRef &clientRequester) override
 Informal notification about a complete read request and response to and from this GATTRole::Server, optional. More...
 
void writeRequest (const uint16_t handle, const jau::TROOctets &data, const jau::darray< Section > &sections, const bool with_response, const BTDeviceRef &serverDest, const BTDeviceRef &clientSource) override
 Informal notification about a completed write request sent to this GATTRole::Server, optional. More...
 
void writeResponse (const AttPDUMsg &pduReply, const AttErrorRsp::ErrorCode error_code, const BTDeviceRef &serverSource, const BTDeviceRef &clientDest) override
 Informal notification about a write response received from this GATTRole::Server, optional. More...
 
- Public Member Functions inherited from direct_bt::BTGattHandler::NativeGattCharListener
virtual ~NativeGattCharListener () noexcept=default
 
virtual void indicationReceived (const BTDeviceRef &, const uint16_t charHandle, const jau::TROOctets &charValue, const uint64_t timestamp, const bool confirmationSent)=0
 Called from native BLE stack, initiated by a received indication. More...
 
virtual void mtuResponse (const uint16_t clientMTU, const AttPDUMsg &pduReply, const AttErrorRsp::ErrorCode error_reply, const uint16_t serverMTU, const uint16_t usedMTU, const BTDeviceRef &serverReplier, const BTDeviceRef &clientRequester)
 Informal notification about a complete MTU exchange request and response to and from this GATTRole::Server, optional. More...
 
virtual void notificationReceived (const BTDeviceRef &source, const uint16_t charHandle, const jau::TROOctets &charValue, const uint64_t timestamp)=0
 Called from native BLE stack, initiated by a received notification. More...
 
bool operator!= (const NativeGattCharListener &rhs) const noexcept
 
virtual bool operator== (const NativeGattCharListener &rhs) const noexcept
 Default comparison operator, merely testing for same memory reference. More...
 
virtual void readResponse (const uint16_t handle, const uint16_t value_offset, const AttPDUMsg &pduReply, const AttErrorRsp::ErrorCode error_reply, const jau::TROOctets &data_reply, const BTDeviceRef &serverReplier, const BTDeviceRef &clientRequester)
 Informal notification about a complete read request and response to and from this GATTRole::Server, optional. More...
 
virtual void replyReceived (const AttPDUMsg &pduReply, const BTDeviceRef &serverSource, const BTDeviceRef &clientDest)
 Informal low-level notification of AttPDUMsg responses from this GATTRole::Server, optional. More...
 
virtual void requestSent (const AttPDUMsg &pduRequest, const BTDeviceRef &serverDest, const BTDeviceRef &clientSource)
 Informal low-level notification of AttPDUMsg requests to this GATTRole::Server, optional. More...
 
virtual std::string toString ()
 Return a simple description about this instance. More...
 
virtual void writeRequest (const uint16_t handle, const jau::TROOctets &data, const jau::darray< Section > &sections, const bool with_response, const BTDeviceRef &serverDest, const BTDeviceRef &clientSource)
 Informal notification about a completed write request sent to this GATTRole::Server, optional. More...
 
virtual void writeResponse (const AttPDUMsg &pduReply, const AttErrorRsp::ErrorCode error_code, const BTDeviceRef &serverSource, const BTDeviceRef &clientDest)
 Informal notification about a write response received from this GATTRole::Server, optional. More...
 

Detailed Description

Examples
dbt_repeater00.cpp.

Definition at line 274 of file dbt_repeater00.cpp.

Constructor & Destructor Documentation

◆ NativeGattToServerCharListener()

NativeGattToServerCharListener::NativeGattToServerCharListener ( )
default

Member Function Documentation

◆ getToClient()

BTDeviceRef NativeGattToServerCharListener::getToClient ( )
inlinenoexcept
Examples
dbt_repeater00.cpp.

Definition at line 279 of file dbt_repeater00.cpp.

Here is the caller graph for this function:

◆ notificationReceived()

void NativeGattToServerCharListener::notificationReceived ( const BTDeviceRef source,
const uint16_t  charHandle,
const TROOctets charValue,
const uint64_t  timestamp 
)
inlineoverridevirtual

Called from native BLE stack, initiated by a received notification.

Parameters
sourceBTDevice origin of this notification
charHandlethe GATT characteristic handle related to this notification
charValuethe notification value
timestampmonotonic timestamp at reception, see jau::getCurrentMilliseconds()

Implements direct_bt::BTGattHandler::NativeGattCharListener.

Examples
dbt_repeater00.cpp.

Definition at line 284 of file dbt_repeater00.cpp.

◆ indicationReceived()

void NativeGattToServerCharListener::indicationReceived ( const BTDeviceRef ,
const uint16_t  charHandle,
const TROOctets charValue,
const uint64_t  timestamp,
const bool  confirmationSent 
)
inlineoverridevirtual

Called from native BLE stack, initiated by a received indication.

Parameters
sourceBTDevice origin of this indication
charHandlethe GATT characteristic handle 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.

Implements direct_bt::BTGattHandler::NativeGattCharListener.

Examples
dbt_repeater00.cpp.

Definition at line 303 of file dbt_repeater00.cpp.

◆ mtuResponse()

void NativeGattToServerCharListener::mtuResponse ( const uint16_t  clientMTU,
const AttPDUMsg pduReply,
const AttErrorRsp::ErrorCode  error_reply,
const uint16_t  serverMTU,
const uint16_t  usedMTU,
const BTDeviceRef serverReplier,
const BTDeviceRef clientRequester 
)
inlineoverridevirtual

Informal notification about a complete MTU exchange request and response to and from this GATTRole::Server, optional.

Parameters
clientMTUthe client MTU request
pduReplythe response
error_replyin case of an AttErrorRsp reply, the AttErrorRsp::ErrorCode is passed for convenience, otherwise AttErrorRsp::ErrorCode::NO_ERROR.
serverMTUthe replied server MTU, passed for convenience
usedMTUthe MTU minimum of client and server to be used, passed for convenience
serverReplierthe GATTRole::Server replier device, never null
clientRequesterthe GATTRole::Client requester device, only known and not nullptr for DBGattServer::Mode:FWD GattServerHandler

Reimplemented from direct_bt::BTGattHandler::NativeGattCharListener.

Examples
dbt_repeater00.cpp.

Definition at line 323 of file dbt_repeater00.cpp.

◆ writeRequest()

void NativeGattToServerCharListener::writeRequest ( const uint16_t  handle,
const jau::TROOctets data,
const jau::darray< Section > &  sections,
const bool  with_response,
const BTDeviceRef serverDest,
const BTDeviceRef clientSource 
)
inlineoverridevirtual

Informal notification about a completed write request sent to this GATTRole::Server, optional.

Parameters
handlethe GATT characteristic or descriptor handle, requested to be written
datathe data requested to be written
sectionslist of NativeGattCharListener::Section within given data, requested to be written. Overlapping consecutive sections have already been merged.
with_responsetrue if the write requests expects a response, i.e. via AttPDUMsg::Opcode::WRITE_REQ or AttPDUMsg::Opcode::EXECUTE_WRITE_REQ
serverDestthe GATTRole::Server receiver device, never null
clientSourcethe GATTRole::Client source device, only known and not nullptr for DBGattServer::Mode:FWD GattServerHandler

Reimplemented from direct_bt::BTGattHandler::NativeGattCharListener.

Examples
dbt_repeater00.cpp.

Definition at line 342 of file dbt_repeater00.cpp.

◆ writeResponse()

void NativeGattToServerCharListener::writeResponse ( const AttPDUMsg pduReply,
const AttErrorRsp::ErrorCode  error_code,
const BTDeviceRef serverSource,
const BTDeviceRef clientDest 
)
inlineoverridevirtual

Informal notification about a write response received from this GATTRole::Server, optional.

Parameters
pduReplythe write response
error_codein case of an AttErrorRsp reply, the AttErrorRsp::ErrorCode is passed for convenience, otherwise AttErrorRsp::ErrorCode::NO_ERROR.
serverSourcethe GATTRole::Server source device, never null
clientDestthe GATTRole::Client receiver device, only known and not nullptr for DBGattServer::Mode:FWD GattServerHandler

Reimplemented from direct_bt::BTGattHandler::NativeGattCharListener.

Examples
dbt_repeater00.cpp.

Definition at line 363 of file dbt_repeater00.cpp.

◆ readResponse()

void NativeGattToServerCharListener::readResponse ( const uint16_t  handle,
const uint16_t  value_offset,
const AttPDUMsg pduReply,
const AttErrorRsp::ErrorCode  error_reply,
const jau::TROOctets data_reply,
const BTDeviceRef serverReplier,
const BTDeviceRef clientRequester 
)
inlineoverridevirtual

Informal notification about a complete read request and response to and from this GATTRole::Server, optional.

Parameters
handlethe GATT characteristic or descriptor handle, requested to be written
value_offsetthe value offset of the data to be read
pduReplythe response
error_replyin case of an AttErrorRsp reply, the AttErrorRsp::ErrorCode is passed for convenience, otherwise AttErrorRsp::ErrorCode::NO_ERROR.
data_replythe replied read data at given value_offset, passed for convenience
serverReplierthe GATTRole::Server replier device, never null
clientRequesterthe GATTRole::Client requester device, only known and not nullptr for DBGattServer::Mode:FWD GattServerHandler

Reimplemented from direct_bt::BTGattHandler::NativeGattCharListener.

Examples
dbt_repeater00.cpp.

Definition at line 377 of file dbt_repeater00.cpp.


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