Read/Write L2CAP communication channel.
More...
#include <L2CAPComm.hpp>
|
| | L2CAPComm (const BDAddressAndType &adapterAddressAndType, const L2CAP_PSM psm, const L2CAP_CID cid) |
| | Constructing a non connected L2CAP channel instance for the pre-defined PSM and CID. More...
|
| |
| | L2CAPComm (const L2CAPComm &)=delete |
| |
| void | operator= (const L2CAPComm &)=delete |
| |
| | ~L2CAPComm () noexcept |
| | Destructor closing the L2CAP channel, see disconnect(). More...
|
| |
| bool | open (const BTDevice &device, const BTSecurityLevel sec_level=BTSecurityLevel::NONE) |
| | Opens and connects the L2CAP channel, locking mutex_write(). More...
|
| |
| bool | isOpen () const |
| |
| bool | close () noexcept |
| | Closing the L2CAP channel, locking mutex_write(). More...
|
| |
| int | getSocketDescriptor () const noexcept |
| | Return this L2CAP socket descriptor. More...
|
| |
| bool | hasIOError () const |
| |
| std::string | getStateString () const |
| |
| std::recursive_mutex & | mutex_write () |
| | Return the recursive write mutex for multithreading access. More...
|
| |
| bool | setBTSecurityLevel (const BTSecurityLevel sec_level) |
| | If sec_level > BTSecurityLevel::UNSET, sets the BlueZ's L2CAP socket BT_SECURITY sec_level, determining the SMP security mode per connection. More...
|
| |
| BTSecurityLevel | getBTSecurityLevel () |
| | Fetches the current BlueZ's L2CAP socket BT_SECURITY sec_level. More...
|
| |
| jau::snsize_t | read (uint8_t *buffer, const jau::nsize_t capacity) |
| | Generic read, w/o locking suitable for a unique ringbuffer sink. More...
|
| |
| jau::snsize_t | write (const uint8_t *buffer, const jau::nsize_t length) |
| | Generic write, locking mutex_write(). More...
|
| |
Read/Write L2CAP communication channel.
Definition at line 113 of file L2CAPComm.hpp.
◆ Defaults
◆ L2CAPComm() [1/2]
Constructing a non connected L2CAP channel instance for the pre-defined PSM and CID.
Definition at line 109 of file L2CAPComm.cpp.
◆ L2CAPComm() [2/2]
| direct_bt::L2CAPComm::L2CAPComm |
( |
const L2CAPComm & |
| ) |
|
|
delete |
◆ ~L2CAPComm()
| direct_bt::L2CAPComm::~L2CAPComm |
( |
| ) |
|
|
inlinenoexcept |
◆ close()
| bool L2CAPComm::close |
( |
| ) |
|
|
noexcept |
◆ getBTSecurityLevel()
◆ getSocketDescriptor()
| int direct_bt::L2CAPComm::getSocketDescriptor |
( |
| ) |
const |
|
inlinenoexcept |
Return this L2CAP socket descriptor.
Definition at line 175 of file L2CAPComm.hpp.
◆ getStateString() [1/2]
| std::string direct_bt::L2CAPComm::getStateString |
( |
| ) |
const |
|
inline |
◆ getStateString() [2/2]
| static std::string direct_bt::L2CAPComm::getStateString |
( |
bool |
isConnected, |
|
|
bool |
hasIOError |
|
) |
| |
|
inlinestatic |
◆ hasIOError()
| bool direct_bt::L2CAPComm::hasIOError |
( |
| ) |
const |
|
inline |
◆ isOpen()
| bool direct_bt::L2CAPComm::isOpen |
( |
| ) |
const |
|
inline |
◆ mutex_write()
| std::recursive_mutex& direct_bt::L2CAPComm::mutex_write |
( |
| ) |
|
|
inline |
Return the recursive write mutex for multithreading access.
Definition at line 181 of file L2CAPComm.hpp.
◆ number()
| static constexpr int direct_bt::L2CAPComm::number |
( |
const Defaults |
d | ) |
|
|
inlinestaticconstexpr |
◆ open()
Opens and connects the L2CAP channel, locking mutex_write().
BT Core Spec v5.2: Vol 3, Part A: L2CAP_CONNECTION_REQ
- Parameters
-
| device | the remote device to establish this L2CAP connection |
| sec_level | sec_level < BTSecurityLevel::NONE will not set security level |
- Returns
- true if connection has been established, otherwise false
Definition at line 130 of file L2CAPComm.cpp.
◆ operator=()
| void direct_bt::L2CAPComm::operator= |
( |
const L2CAPComm & |
| ) |
|
|
delete |
◆ read()
◆ setBTSecurityLevel()
If sec_level > BTSecurityLevel::UNSET, sets the BlueZ's L2CAP socket BT_SECURITY sec_level, determining the SMP security mode per connection.
To unset security, the L2CAP socket should be closed and opened again.
- Parameters
-
- Returns
- true if a security level > BTSecurityLevel::UNSET has been set successfully, false if no security level has been set or if it failed.
Definition at line 289 of file L2CAPComm.cpp.
◆ write()
The documentation for this class was generated from the following files: