Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
A thread safe SMP handler associated to one device via one L2CAP connection. More...
#include <SMPHandler.hpp>
Public Types | |
enum | Defaults : int32_t { Defaults::MIN_SMP_MTU = 23, Defaults::LE_SECURE_SMP_MTU = 65, Defaults::SMP_MTU_BUFFER_SZ = 128 } |
Public Member Functions | |
SMPHandler (const std::shared_ptr< BTDevice > &device) noexcept | |
SMPHandler (const SMPHandler &)=delete | |
void | operator= (const SMPHandler &)=delete |
~SMPHandler () noexcept | |
Destructor closing this instance including L2CAP channel, see disconnect(). More... | |
std::shared_ptr< BTDevice > | getDeviceUnchecked () const noexcept |
std::shared_ptr< BTDevice > | getDeviceChecked () const |
bool | isConnected () const noexcept |
bool | hasIOError () const noexcept |
std::string | getStateString () const noexcept |
bool | establishSecurity (const BTSecurityLevel sec_level) |
If sec_level > BTSecurityLevel::UNSET, change security level per L2CAP connection. More... | |
bool | disconnect (const bool disconnectDevice, const bool ioErrorCause) noexcept |
Disconnect this GATTHandler and optionally the associated device. More... | |
void | addSMPSecurityReqCallback (const SMPSecurityReqCallback &l) |
int | removeSMPSecurityReqCallback (const SMPSecurityReqCallback &l) |
Static Public Member Functions | |
static constexpr int | number (const Defaults d) |
Static Public Attributes | |
static bool | IS_SUPPORTED_BY_OS = false |
Linux/BlueZ prohibits access to the existing SMP implementation via L2CAP (socket). More... | |
A thread safe SMP handler associated to one device via one L2CAP connection.
Implementation utilizes a lock free ringbuffer receiving data within its separate thread.
Controlling Environment variables, see SMPEnv.
See
Definition at line 169 of file SMPHandler.hpp.
|
strong |
Enumerator | |
---|---|
MIN_SMP_MTU | |
LE_SECURE_SMP_MTU | |
SMP_MTU_BUFFER_SZ |
Definition at line 176 of file SMPHandler.hpp.
|
noexcept |
|
delete |
|
noexcept |
Destructor closing this instance including L2CAP channel, see disconnect().
Definition at line 198 of file SMPHandler.cpp.
void SMPHandler::addSMPSecurityReqCallback | ( | const SMPSecurityReqCallback & | l | ) |
|
noexcept |
Disconnect this GATTHandler and optionally the associated device.
disconnectDevice | if true, associated device will also be disconnected, otherwise not. |
ioErrorCause | if true, reason for disconnection is an IO error |
Definition at line 210 of file SMPHandler.cpp.
bool SMPHandler::establishSecurity | ( | const BTSecurityLevel | sec_level | ) |
If sec_level > BTSecurityLevel::UNSET, change security level per L2CAP connection.
sec_level | sec_level < BTSecurityLevel::NONE will not set security level and returns false. |
Definition at line 203 of file SMPHandler.cpp.
std::shared_ptr< BTDevice > SMPHandler::getDeviceChecked | ( | ) | const |
Definition at line 75 of file SMPHandler.cpp.
|
inlinenoexcept |
Definition at line 231 of file SMPHandler.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 235 of file SMPHandler.hpp.
|
inlinenoexcept |
Definition at line 234 of file SMPHandler.hpp.
|
inlinestaticconstexpr |
Definition at line 185 of file SMPHandler.hpp.
|
delete |
int SMPHandler::removeSMPSecurityReqCallback | ( | const SMPSecurityReqCallback & | l | ) |
|
static |
Linux/BlueZ prohibits access to the existing SMP implementation via L2CAP (socket).
Definition at line 174 of file SMPHandler.hpp.