Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
Handles the Security Manager Protocol (SMP) using Protocol Data Unit (PDU) encoded messages over L2CAP channel. More...
#include <SMPTypes.hpp>
Public Types | |
enum class | Opcode : uint8_t { UNDEFINED = 0x00 , PAIRING_REQUEST = 0x01 , PAIRING_RESPONSE = 0x02 , PAIRING_CONFIRM = 0x03 , PAIRING_RANDOM = 0x04 , PAIRING_FAILED = 0x05 , ENCRYPTION_INFORMATION = 0x06 , MASTER_IDENTIFICATION = 0x07 , IDENTITY_INFORMATION = 0x08 , IDENTITY_ADDRESS_INFORMATION = 0x09 , SIGNING_INFORMATION = 0x0A , SECURITY_REQUEST = 0x0B , PAIRING_PUBLIC_KEY = 0x0C , PAIRING_DHKEY_CHECK = 0x0D , PAIRING_KEYPRESS_NOTIFICATION = 0x0E } |
SMP Command Codes Vol 3, Part H (SM): 3.3. More... | |
Public Member Functions | |
SMPPDUMsg (const Opcode opc, const jau::nsize_t size) | |
Persistent memory, w/ ownership . More... | |
SMPPDUMsg (const uint8_t *source, const jau::nsize_t size) | |
Persistent memory, w/ ownership . More... | |
SMPPDUMsg (const uint8_t *source, const jau::nsize_t size, const jau::nsize_t min_size) | |
Persistent memory, w/ ownership . More... | |
virtual | ~SMPPDUMsg () noexcept=default |
constexpr jau::nsize_t | getDataOffset () const noexcept |
Returns the octet offset to the data segment in this PDU including the mandatory opcode, i.e. More... | |
virtual constexpr_cxx20 jau::nsize_t | getDataSize () const noexcept |
Returns the required data size according to the specified packet, which should be within 0-22 or 64 octets. More... | |
virtual std::string | getName () const noexcept |
constexpr Opcode | getOpcode () const noexcept |
SMP Command Codes Vol 3, Part H (SM): 3.3. More... | |
constexpr jau::nsize_t | getPDUParamSize () const noexcept |
Returns the actual PDU size less one octet for the opcode, which should result in 0-22 octets or 64 octets. More... | |
constexpr uint64_t | getTimestamp () const noexcept |
virtual std::string | toString () const noexcept |
Static Public Member Functions | |
template<class T > | |
static T * | clone (const T &source) noexcept |
Clone template for convenience, based on derived class's copy-constructor. More... | |
static std::string | getOpcodeString (const Opcode opc) noexcept |
static std::unique_ptr< const SMPPDUMsg > | getSpecialized (const uint8_t *buffer, jau::nsize_t const buffer_size) noexcept |
Return a newly created specialized instance pointer to base class. More... | |
static constexpr uint8_t | number (const Opcode rhs) noexcept |
Protected Member Functions | |
virtual std::string | baseString () const noexcept |
void | check_range () |
void | checkOpcode (const Opcode exp1, const Opcode exp2) const |
void | checkOpcode (const Opcode expected) const |
virtual std::string | valueString () const noexcept |
Protected Attributes | |
jau::POctets | pdu |
actual received PDU More... | |
uint64_t | ts_creation |
creation timestamp in milliseconds More... | |
Friends | |
class | SMPHandler |
Handles the Security Manager Protocol (SMP) using Protocol Data Unit (PDU) encoded messages over L2CAP channel.
Vol 3 (Host), Part H (SM): 3 (SMP), 3.3 Command Format
Message format between both devices, negotiating security details.
Vol 3 (Host), Part H Security Manager Specification (SM): 1.2.1 Bit and byte ordering conventions
Little-Endian: Multiple-octet fields shall be transmitted with the least significant octet first.
Definition at line 841 of file SMPTypes.hpp.
|
strong |
SMP Command Codes Vol 3, Part H (SM): 3.3.
Definition at line 845 of file SMPTypes.hpp.
|
inline |
Persistent memory, w/ ownership .
Definition at line 920 of file SMPTypes.hpp.
|
inline |
Persistent memory, w/ ownership .
Definition at line 926 of file SMPTypes.hpp.
|
inline |
Persistent memory, w/ ownership .
Definition at line 934 of file SMPTypes.hpp.
|
virtualdefaultnoexcept |
|
inlinestaticconstexprnoexcept |
|
staticnoexcept |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Definition at line 885 of file SMPTypes.hpp.
|
inlineprotectedvirtualnoexcept |
|
inlineprotectedvirtualnoexcept |
Reimplemented in direct_bt::SMPPairingMsg, direct_bt::SMPPairConfirmMsg, direct_bt::SMPPairRandMsg, direct_bt::SMPPairFailedMsg, direct_bt::SMPPairPubKeyMsg, direct_bt::SMPPairDHKeyCheckMsg, direct_bt::SMPPasskeyNotification, direct_bt::SMPEncInfoMsg, direct_bt::SMPMasterIdentMsg, direct_bt::SMPIdentInfoMsg, direct_bt::SMPIdentAddrInfoMsg, direct_bt::SMPSignInfoMsg, and direct_bt::SMPSecurityReqMsg.
Definition at line 899 of file SMPTypes.hpp.
|
staticnoexcept |
Return a newly created specialized instance pointer to base class.
Returned memory reference is managed by caller (delete etc)
Definition at line 426 of file SMPTypes.cpp.
|
inlinestaticnoexcept |
Clone template for convenience, based on derived class's copy-constructor.
const SMPPDUMsg & smpPDU; const SMPSignInfoMsg * signInfo = static_cast<const SMPSignInfoMsg *>(&smpPDU); SMPPDUMsg* b1 = SMPPDUMsg::clone(*signInfo); SMPSignInfoMsg* b2 = SMPPDUMsg::clone(*signInfo);
T | The derived definite class type, deducible by source argument |
source | the source to be copied |
Definition at line 956 of file SMPTypes.hpp.
|
inlineconstexprnoexcept |
Definition at line 958 of file SMPTypes.hpp.
|
inlineconstexprnoexcept |
SMP Command Codes Vol 3, Part H (SM): 3.3.
Definition at line 961 of file SMPTypes.hpp.
|
inlineconstexprnoexcept |
Returns the actual PDU size less one octet for the opcode, which should result in 0-22 octets or 64 octets.
Note that the PDU parameter include the data value below.
Use getDataSize() for the actual required data size according to the specific packet.
Definition at line 978 of file SMPTypes.hpp.
|
inlinevirtualnoexcept |
Returns the required data size according to the specified packet, which should be within 0-22 or 64 octets.
Reimplemented in direct_bt::SMPPairingMsg, direct_bt::SMPPairConfirmMsg, direct_bt::SMPPairRandMsg, direct_bt::SMPPairFailedMsg, direct_bt::SMPPairPubKeyMsg, direct_bt::SMPPairDHKeyCheckMsg, direct_bt::SMPPasskeyNotification, direct_bt::SMPEncInfoMsg, direct_bt::SMPMasterIdentMsg, direct_bt::SMPIdentInfoMsg, direct_bt::SMPIdentAddrInfoMsg, direct_bt::SMPSignInfoMsg, and direct_bt::SMPSecurityReqMsg.
Definition at line 988 of file SMPTypes.hpp.
|
inlineconstexprnoexcept |
Returns the octet offset to the data segment in this PDU including the mandatory opcode, i.e.
the number of octets until the first value octet.
Definition at line 998 of file SMPTypes.hpp.
|
inlinevirtualnoexcept |
Reimplemented in direct_bt::SMPPairingMsg, direct_bt::SMPPairConfirmMsg, direct_bt::SMPPairRandMsg, direct_bt::SMPPairFailedMsg, direct_bt::SMPPairPubKeyMsg, direct_bt::SMPPairDHKeyCheckMsg, direct_bt::SMPPasskeyNotification, direct_bt::SMPEncInfoMsg, direct_bt::SMPMasterIdentMsg, direct_bt::SMPIdentInfoMsg, direct_bt::SMPIdentAddrInfoMsg, direct_bt::SMPSignInfoMsg, and direct_bt::SMPSecurityReqMsg.
Definition at line 1000 of file SMPTypes.hpp.
|
inlinevirtualnoexcept |
Definition at line 1004 of file SMPTypes.hpp.
|
friend |
Definition at line 871 of file SMPTypes.hpp.
|
protected |
actual received PDU
Definition at line 905 of file SMPTypes.hpp.
|
protected |
creation timestamp in milliseconds
Definition at line 908 of file SMPTypes.hpp.