Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
direct_bt::SMPLinkKey Struct Reference

Local SMP Link Key, used for platform agnostic persistence, mapping to platform specific MgmtLoadLinkKeyCmd and MgmtEvtNewLinkKey. More...

#include <SMPTypes.hpp>

Collaboration diagram for direct_bt::SMPLinkKey:

Public Types

enum class  KeyType : uint8_t {
  COMBI = 0x00 LOCAL_UNIT = 0x01 , REMOTE_UNIT = 0x02 , DBG_COMBI = 0x03 , UNAUTH_COMBI_P192 = 0x04 ,
  AUTH_COMBI_P192 = 0x05 , CHANGED_COMBI = 0x06 , UNAUTH_COMBI_P256 = 0x07 , AUTH_COMBI_P256 = 0x08 ,
  NONE = 0xff
}
 

Public Member Functions

void clear () noexcept
 
constexpr bool isCombiKey () const noexcept
 
bool isResponder () const noexcept
 
constexpr bool isValid () const noexcept
 
std::string toString () const noexcept
 

Static Public Member Functions

static std::string getTypeString (const KeyType type) noexcept
 
static constexpr uint8_t number (const KeyType rhs) noexcept
 

Public Attributes

jau::uint128dp_t key
 
uint8_t pin_length
 
bool responder
 
KeyType type
 

Detailed Description

Local SMP Link Key, used for platform agnostic persistence, mapping to platform specific MgmtLoadLinkKeyCmd and MgmtEvtNewLinkKey.

Notable: No endian wise conversion shall occur on this data, since the encryption values are interpreted as little-endian or as a byte stream.

Byte layout must be synchronized with java org.tinyb.SMPLinkKey

Definition at line 824 of file SMPTypes.hpp.

Member Enumeration Documentation

◆ KeyType

enum class direct_bt::SMPLinkKey::KeyType : uint8_t
strong
  • Link Key type compatible with Mgmt's MgmtLinkKeyType and hence MgmtLinkKeyInfo
Enumerator
COMBI 

Combination key.

REMOTE_UNIT 

Remote Unit key.

DBG_COMBI 

Debug Combination key.

UNAUTH_COMBI_P192 

Unauthenticated Combination key from P-192.

AUTH_COMBI_P192 

Authenticated Combination key from P-192.

CHANGED_COMBI 

Changed Combination key.

UNAUTH_COMBI_P256 

Unauthenticated Combination key from P-256.

AUTH_COMBI_P256 

Authenticated Combination key from P-256.

NONE 

Denoting no or invalid link key type.

Definition at line 824 of file SMPTypes.hpp.

Member Function Documentation

◆ number()

static constexpr uint8_t direct_bt::SMPLinkKey::number ( const KeyType  rhs)
inlinestaticconstexprnoexcept

Definition at line 824 of file SMPTypes.hpp.

◆ getTypeString()

std::string SMPLinkKey::getTypeString ( const KeyType  type)
staticnoexcept

Definition at line 352 of file SMPTypes.cpp.

◆ isValid()

constexpr bool direct_bt::SMPLinkKey::isValid ( ) const
inlineconstexprnoexcept

Definition at line 824 of file SMPTypes.hpp.

Here is the caller graph for this function:

◆ isCombiKey()

constexpr bool direct_bt::SMPLinkKey::isCombiKey ( ) const
inlineconstexprnoexcept
  • Returns true if the type is a combination key, * i.e. used for BTRole::Master and BTRole::Slave. * * This is usally being true when using Secure Connections (SC).

Definition at line 824 of file SMPTypes.hpp.

◆ isResponder()

bool direct_bt::SMPLinkKey::isResponder ( ) const
inlinenoexcept

Definition at line 824 of file SMPTypes.hpp.

◆ clear()

void direct_bt::SMPLinkKey::clear ( )
inlinenoexcept

Definition at line 824 of file SMPTypes.hpp.

◆ toString()

std::string direct_bt::SMPLinkKey::toString ( ) const
inlinenoexcept

Definition at line 824 of file SMPTypes.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ responder

bool direct_bt::SMPLinkKey::responder

Definition at line 824 of file SMPTypes.hpp.

◆ type

KeyType direct_bt::SMPLinkKey::type

Definition at line 824 of file SMPTypes.hpp.

◆ key

jau::uint128dp_t direct_bt::SMPLinkKey::key

Definition at line 824 of file SMPTypes.hpp.

◆ pin_length

uint8_t direct_bt::SMPLinkKey::pin_length

Definition at line 824 of file SMPTypes.hpp.


The documentation for this struct was generated from the following files: