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

L2CAP server socket to listen for connecting remote devices. More...

#include <L2CAPComm.hpp>

Inheritance diagram for direct_bt::L2CAPServer:
Collaboration diagram for direct_bt::L2CAPServer:

Public Member Functions

 L2CAPServer (const uint16_t adev_id, BDAddressAndType localAddressAndType, const L2CAP_PSM psm, const L2CAP_CID cid) noexcept
 
 ~L2CAPServer () noexcept override
 Destructor closing the L2CAP channel, see close(). More...
 
std::unique_ptr< L2CAPClientaccept () noexcept
 
bool close () noexcept override
 Closing the L2CAP socket, see specializations. More...
 
std::string getStateString () const noexcept override
 
bool open () noexcept
 
std::string toString () const noexcept override
 
- Public Member Functions inherited from direct_bt::L2CAPComm
 L2CAPComm (const L2CAPComm &)=delete
 
 L2CAPComm (const uint16_t adev_id, BDAddressAndType localAddressAndType, const L2CAP_PSM psm, const L2CAP_CID cid) noexcept
 
virtual ~L2CAPComm () noexcept=default
 Destructor specialization shall close the L2CAP socket, see close(). More...
 
virtual bool close () noexcept=0
 Closing the L2CAP socket, see specializations. More...
 
virtual std::string getStateString () const noexcept=0
 
bool interrupted () const noexcept
 Returns true if interrupted by internal or external cause, hence shall stop connecting and reading. More...
 
bool is_open () const noexcept
 
void operator= (const L2CAPComm &)=delete
 
void set_interrupted_query (get_boolean_callback_t is_interrupted_cb) noexcept
 The external is interrupted callback is used until close(), thereafter it is removed. More...
 
int socket () const noexcept
 Return this L2CAP socket descriptor. More...
 
virtual std::string toString () const noexcept=0
 

Additional Inherited Members

- Public Types inherited from direct_bt::L2CAPComm
typedef jau::function< bool(int)> get_boolean_callback_t
 Utilized to query for external interruption, whether device is still connected etc. More...
 
- Static Public Member Functions inherited from direct_bt::L2CAPComm
static std::string getStateString (bool isOpen, bool hasIOError) noexcept
 
static std::string getStateString (bool isOpen, bool irqed_int, bool irqed_ext, bool hasIOError) noexcept
 
static std::string getStateString (bool isOpen, bool isInterrupted, bool hasIOError) noexcept
 
- Public Attributes inherited from direct_bt::L2CAPComm
const uint16_t adev_id
 Corresponding BTAdapter device id. More...
 
const L2CAP_CID cid
 Corresponding L2CAP_CID for the channel. More...
 
const BDAddressAndType localAddressAndType
 Corresponding BTAdapter local BTAddressAndType. More...
 
const L2CAP_PSM psm
 Corresponding L2CAP_PSM for the channel. More...
 
- Protected Member Functions inherited from direct_bt::L2CAPComm
BTSecurityLevel getBTSecurityLevelImpl (const BDAddressAndType &remoteAddressAndType) noexcept
 
bool interrupted_ext () const noexcept
 Returns true if interrupted by external cause. More...
 
bool interrupted_int () const noexcept
 Returns true if interrupted by internal cause. More...
 
bool setBTSecurityLevelImpl (const BTSecurityLevel sec_level, const BDAddressAndType &remoteAddressAndType) noexcept
 
- Static Protected Member Functions inherited from direct_bt::L2CAPComm
static int l2cap_close_dev (int dd) noexcept
 
static int l2cap_open_dev (const BDAddressAndType &adapterAddressAndType, const L2CAP_PSM psm, const L2CAP_CID cid) noexcept
 
- Protected Attributes inherited from direct_bt::L2CAPComm
const L2CAPEnvenv
 
jau::sc_atomic_bool interrupted_intern
 
get_boolean_callback_t is_interrupted_extern
 
jau::sc_atomic_bool is_open_
 
std::recursive_mutex mtx_open
 
jau::relaxed_atomic_int socket_
 

Detailed Description

L2CAP server socket to listen for connecting remote devices.

Definition at line 317 of file L2CAPComm.hpp.

Constructor & Destructor Documentation

◆ L2CAPServer()

L2CAPServer::L2CAPServer ( const uint16_t  adev_id,
BDAddressAndType  localAddressAndType,
const L2CAP_PSM  psm,
const L2CAP_CID  cid 
)
noexcept

Definition at line 726 of file L2CAPComm.cpp.

◆ ~L2CAPServer()

direct_bt::L2CAPServer::~L2CAPServer ( )
inlineoverridenoexcept

Destructor closing the L2CAP channel, see close().

Definition at line 327 of file L2CAPComm.hpp.

Member Function Documentation

◆ open()

bool L2CAPServer::open ( )
noexcept

Definition at line 730 of file L2CAPComm.cpp.

◆ close()

bool direct_bt::L2CAPServer::close ( )
inlineoverridevirtualnoexcept

Closing the L2CAP socket, see specializations.

Implements direct_bt::L2CAPComm.

Definition at line 333 of file L2CAPComm.hpp.

Here is the caller graph for this function:

◆ accept()

std::unique_ptr< L2CAPClient > L2CAPServer::accept ( )
noexcept

Definition at line 818 of file L2CAPComm.cpp.

Here is the caller graph for this function:

◆ getStateString()

std::string direct_bt::L2CAPServer::getStateString ( ) const
inlineoverridevirtualnoexcept

Implements direct_bt::L2CAPComm.

Definition at line 337 of file L2CAPComm.hpp.

Here is the caller graph for this function:

◆ toString()

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

Implements direct_bt::L2CAPComm.

Definition at line 889 of file L2CAPComm.cpp.


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