|
Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
L2CAP client/server socket abstract base class to listen for connecting remote devices. More...
#include <L2CAPComm.hpp>
Public Types | |
| typedef jau::function< bool(int)> | get_boolean_callback_t |
| Utilized to query for external interruption, whether device is still connected etc. More... | |
Public Member Functions | |
| 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 |
Static Public Member Functions | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| const L2CAPEnv & | env |
| 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_ |
L2CAP client/server socket abstract base class to listen for connecting remote devices.
Definition at line 123 of file L2CAPComm.hpp.
| typedef jau::function<bool(int )> direct_bt::L2CAPComm::get_boolean_callback_t |
Utilized to query for external interruption, whether device is still connected etc.
Definition at line 130 of file L2CAPComm.hpp.
|
noexcept |
Definition at line 147 of file L2CAPComm.cpp.
|
virtualdefaultnoexcept |
Destructor specialization shall close the L2CAP socket, see close().
|
delete |
|
staticnoexcept |
Definition at line 84 of file L2CAPComm.cpp.
|
staticnoexcept |
|
staticnoexcept |
Definition at line 90 of file L2CAPComm.cpp.
|
staticprotectednoexcept |
|
staticprotectednoexcept |
Definition at line 142 of file L2CAPComm.cpp.
|
protectednoexcept |
Definition at line 156 of file L2CAPComm.cpp.
|
protectednoexcept |
|
inlineprotectednoexcept |
Returns true if interrupted by internal cause.
Definition at line 159 of file L2CAPComm.hpp.
|
inlineprotectednoexcept |
Returns true if interrupted by external cause.
Definition at line 162 of file L2CAPComm.hpp.
|
delete |
|
inlinenoexcept |
Definition at line 173 of file L2CAPComm.hpp.
|
inlinenoexcept |
The external is interrupted callback is used until close(), thereafter it is removed.
Definition at line 176 of file L2CAPComm.hpp.
|
inlinenoexcept |
Returns true if interrupted by internal or external cause, hence shall stop connecting and reading.
Definition at line 179 of file L2CAPComm.hpp.
|
pure virtualnoexcept |
Closing the L2CAP socket, see specializations.
Implemented in direct_bt::L2CAPClient, and direct_bt::L2CAPServer.
|
inlinenoexcept |
Return this L2CAP socket descriptor.
Definition at line 185 of file L2CAPComm.hpp.
|
pure virtualnoexcept |
Implemented in direct_bt::L2CAPClient, and direct_bt::L2CAPServer.
|
pure virtualnoexcept |
Implemented in direct_bt::L2CAPClient, and direct_bt::L2CAPServer.
|
protected |
Definition at line 136 of file L2CAPComm.hpp.
| const uint16_t direct_bt::L2CAPComm::adev_id |
Corresponding BTAdapter device id.
Definition at line 140 of file L2CAPComm.hpp.
| const BDAddressAndType direct_bt::L2CAPComm::localAddressAndType |
Corresponding BTAdapter local BTAddressAndType.
Definition at line 142 of file L2CAPComm.hpp.
| const L2CAP_PSM direct_bt::L2CAPComm::psm |
Corresponding L2CAP_PSM for the channel.
Definition at line 144 of file L2CAPComm.hpp.
| const L2CAP_CID direct_bt::L2CAPComm::cid |
Corresponding L2CAP_CID for the channel.
Definition at line 146 of file L2CAPComm.hpp.
|
protected |
Definition at line 149 of file L2CAPComm.hpp.
|
protected |
Definition at line 150 of file L2CAPComm.hpp.
|
protected |
Definition at line 151 of file L2CAPComm.hpp.
|
protected |
Definition at line 152 of file L2CAPComm.hpp.
|
protected |
Definition at line 153 of file L2CAPComm.hpp.