Direct-BT v3.3.0-1-gc2d430c
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 class | Defaults : int32_t { MIN_SMP_MTU = 23 , LE_SECURE_SMP_MTU = 65 , SMP_MTU_BUFFER_SZ = 128 } |
typedef jau::nsize_t | size_type |
typedef jau::function< void(const SMPPDUMsg &)> | SMPSecurityReqCallback |
typedef jau::cow_darray< SMPSecurityReqCallback, size_type > | SMPSecurityReqCallbackList |
Public Member Functions | |
SMPHandler (const SMPHandler &)=delete | |
SMPHandler (const std::shared_ptr< BTDevice > &device) noexcept | |
~SMPHandler () noexcept | |
Destructor closing this instance including L2CAP channel, see disconnect() . More... | |
void | addSMPSecurityReqCallback (const SMPSecurityReqCallback &l) |
bool | disconnect (const bool disconnectDevice, const bool ioErrorCause) noexcept |
Disconnect this GATTHandler and optionally the associated device. More... | |
bool | establishSecurity (const BTSecurityLevel sec_level) |
If sec_level > BTSecurityLevel::UNSET, change security level per L2CAP connection. More... | |
std::shared_ptr< BTDevice > | getDeviceChecked () const |
std::shared_ptr< BTDevice > | getDeviceUnchecked () const noexcept |
std::string | getStateString () const noexcept |
bool | hasIOError () const noexcept |
bool | isConnected () const noexcept |
void | operator= (const SMPHandler &)=delete |
size_type | removeSMPSecurityReqCallback (const SMPSecurityReqCallback &l) |
Static Public Member Functions | |
static constexpr int | number (const Defaults d) |
Static Public Attributes | |
static bool | IS_SUPPORTED_BY_OS = SMP_SUPPORTED_BY_OS ? true : 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 163 of file SMPHandler.hpp.
typedef jau::function<void(const SMPPDUMsg&)> direct_bt::SMPHandler::SMPSecurityReqCallback |
Definition at line 181 of file SMPHandler.hpp.
Definition at line 182 of file SMPHandler.hpp.
typedef jau::cow_darray<SMPSecurityReqCallback, size_type> direct_bt::SMPHandler::SMPSecurityReqCallbackList |
Definition at line 183 of file SMPHandler.hpp.
|
strong |
Enumerator | |
---|---|
MIN_SMP_MTU | |
LE_SECURE_SMP_MTU | |
SMP_MTU_BUFFER_SZ |
Definition at line 170 of file SMPHandler.hpp.
|
noexcept |
Definition at line 169 of file SMPHandler.cpp.
|
delete |
|
noexcept |
Destructor closing this instance including L2CAP channel, see disconnect()
.
Definition at line 199 of file SMPHandler.cpp.
|
inlinestaticconstexpr |
Definition at line 179 of file SMPHandler.hpp.
|
delete |
|
inlinenoexcept |
Definition at line 225 of file SMPHandler.hpp.
std::shared_ptr< BTDevice > SMPHandler::getDeviceChecked | ( | ) | const |
Definition at line 73 of file SMPHandler.cpp.
|
inlinenoexcept |
Definition at line 228 of file SMPHandler.hpp.
|
inlinenoexcept |
Definition at line 229 of file SMPHandler.hpp.
|
inlinenoexcept |
Definition at line 230 of file SMPHandler.hpp.
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 204 of file SMPHandler.cpp.
|
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 211 of file SMPHandler.cpp.
void SMPHandler::addSMPSecurityReqCallback | ( | const SMPSecurityReqCallback & | l | ) |
Definition at line 311 of file SMPHandler.cpp.
SMPHandler::size_type SMPHandler::removeSMPSecurityReqCallback | ( | const SMPSecurityReqCallback & | l | ) |
Definition at line 314 of file SMPHandler.cpp.
|
static |
Linux/BlueZ prohibits access to the existing SMP implementation via L2CAP (socket).
Definition at line 168 of file SMPHandler.hpp.