60 SMPException(std::string type, std::string
const& m,
const char* file,
int line) noexcept
64 SMPException(std::string
const& m,
const char* file,
int line) noexcept
88 return static_cast<int>(rhs);
96 return static_cast<uint16_t
>(rhs);
230 return static_cast<uint8_t
>(rhs);
258 return static_cast<uint8_t
>(rhs);
341 return static_cast<SMPAuthReqs> (
static_cast<uint8_t
>(lhs) ^
static_cast<uint8_t
>(rhs) );
344 return static_cast<SMPAuthReqs> (
static_cast<uint8_t
>(lhs) |
static_cast<uint8_t
>(rhs) );
347 return static_cast<SMPAuthReqs> (
static_cast<uint8_t
>(lhs) &
static_cast<uint8_t
>(rhs) );
350 return static_cast<uint8_t
>(lhs) ==
static_cast<uint8_t
>(rhs);
353 return !( lhs == rhs );
356 return static_cast<uint8_t
>(rhs);
359 return bit == ( mask & bit );
460 return static_cast<SMPKeyType> (
static_cast<uint8_t
>(lhs) ^
static_cast<uint8_t
>(rhs) );
463 store =
static_cast<SMPKeyType> (
static_cast<uint8_t
>(store) ^
static_cast<uint8_t
>(rhs) );
467 return static_cast<SMPKeyType> (
static_cast<uint8_t
>(lhs) |
static_cast<uint8_t
>(rhs) );
470 store =
static_cast<SMPKeyType> (
static_cast<uint8_t
>(store) |
static_cast<uint8_t
>(rhs) );
474 return static_cast<SMPKeyType> (
static_cast<uint8_t
>(lhs) &
static_cast<uint8_t
>(rhs) );
477 store =
static_cast<SMPKeyType> (
static_cast<uint8_t
>(store) &
static_cast<uint8_t
>(rhs) );
481 return static_cast<uint8_t
>(lhs) ==
static_cast<uint8_t
>(rhs);
484 return !( lhs == rhs );
487 return static_cast<uint8_t
>(rhs);
490 return bit == ( mask & bit );
504 __pack(
struct SMPLongTermKey {
508 enum class Property : uint8_t {
518 static constexpr uint8_t
number(
const Property rhs)
noexcept {
519 return static_cast<uint8_t
>(rhs);
521 static std::string getPropertyString(
const Property mask)
noexcept;
536 constexpr bool isValid() const noexcept {
return 0 != enc_size; }
538 bool isResponder() const noexcept;
540 void clear() noexcept {
541 bzero(
reinterpret_cast<void *
>(
this),
sizeof(SMPLongTermKey));
544 std::string toString() const noexcept {
545 return "LTK[props "+getPropertyString(properties)+
", enc_size "+
std::to_string(enc_size)+
546 ", ediv "+
jau::bytesHexString(
reinterpret_cast<const uint8_t *
>(&ediv), 0,
sizeof(ediv),
true )+
547 ", rand "+
jau::bytesHexString(
reinterpret_cast<const uint8_t *
>(&rand), 0,
sizeof(rand),
true )+
578 return static_cast<uint8_t
>(lhs) ==
static_cast<uint8_t
>(rhs);
581 return !( lhs == rhs );
595 __pack(
struct SMPIdentityResolvingKey {
599 enum class Property : uint8_t {
607 static constexpr uint8_t
number(
const Property rhs)
noexcept {
608 return static_cast<uint8_t
>(rhs);
610 static std::string getPropertyString(
const Property mask)
noexcept;
619 bool isResponder() const noexcept;
625 static
bool matches(const
jau::uint128dp_t& irk, const
EUI48& rpa) noexcept;
627 void clear() noexcept {
628 bzero(
reinterpret_cast<void *
>(
this),
sizeof(SMPIdentityResolvingKey));
631 std::string toString() const noexcept {
632 return "IRK[props "+getPropertyString(properties)+
659 return static_cast<uint8_t
>(lhs) ==
static_cast<uint8_t
>(rhs);
662 return !( lhs == rhs );
679 __pack(
struct SMPSignatureResolvingKey {
683 enum class Property : uint8_t {
691 static constexpr uint8_t
number(
const Property rhs)
noexcept {
692 return static_cast<uint8_t
>(rhs);
694 static std::string getPropertyString(
const Property mask)
noexcept;
701 bool isResponder() const noexcept;
703 void clear() noexcept {
704 bzero(
reinterpret_cast<void *
>(
this),
sizeof(SMPSignatureResolvingKey));
707 std::string toString() const noexcept {
708 return "CSRK[props "+getPropertyString(properties)+
735 return static_cast<uint8_t
>(lhs) ==
static_cast<uint8_t
>(rhs);
738 return !( lhs == rhs );
753 __pack(
struct SMPLinkKey {
757 enum class KeyType : uint8_t {
767 UNAUTH_COMBI_P192 = 0x04,
769 AUTH_COMBI_P192 = 0x05,
771 CHANGED_COMBI = 0x06,
773 UNAUTH_COMBI_P256 = 0x07,
775 AUTH_COMBI_P256 = 0x08,
779 static constexpr uint8_t
number(
const KeyType rhs)
noexcept {
780 return static_cast<uint8_t
>(rhs);
782 static std::string getTypeString(
const KeyType type)
noexcept;
789 constexpr bool isValid() const noexcept {
return KeyType::NONE != type; }
797 constexpr bool isCombiKey() const noexcept {
800 case KeyType::DBG_COMBI:
801 case KeyType::UNAUTH_COMBI_P192:
802 case KeyType::AUTH_COMBI_P192:
803 case KeyType::CHANGED_COMBI:
804 case KeyType::UNAUTH_COMBI_P256:
805 case KeyType::AUTH_COMBI_P256:
812 bool isResponder() const noexcept {
return responder; }
814 void clear() noexcept {
815 bzero(
reinterpret_cast<void *
>(
this),
sizeof(SMPLinkKey));
818 std::string toString() const noexcept {
819 return "LK[resp "+
std::to_string(responder)+
", type "+getTypeString(type)+
848 PAIRING_REQUEST = 0x01,
849 PAIRING_RESPONSE = 0x02,
850 PAIRING_CONFIRM = 0x03,
851 PAIRING_RANDOM = 0x04,
852 PAIRING_FAILED = 0x05,
854 ENCRYPTION_INFORMATION = 0x06,
855 MASTER_IDENTIFICATION = 0x07,
856 IDENTITY_INFORMATION = 0x08,
857 IDENTITY_ADDRESS_INFORMATION = 0x09,
858 SIGNING_INFORMATION = 0x0A,
859 SECURITY_REQUEST = 0x0B,
861 PAIRING_PUBLIC_KEY = 0x0C,
862 PAIRING_DHKEY_CHECK = 0x0D,
863 PAIRING_KEYPRESS_NOTIFICATION = 0x0E
866 return static_cast<uint8_t
>(rhs);
880 if( expected != has ) {
888 if( exp1 != has && exp2 != has ) {
956 static T*
clone(const T& source) noexcept {
return new T(source); }
1097 initiator_key_dist(static_cast<
SMPKeyType>(
pdu.get_uint8_nc(5))),
1098 responder_key_dist(static_cast<
SMPKeyType>(
pdu.get_uint8_nc(6)))
1106 const SMPAuthReqs auth_req_mask,
const uint8_t maxEncKeySize,
1111 authReqMask(auth_req_mask), initiator_key_dist(initiator_key_dist_), responder_key_dist(responder_key_dist_)
1160 return is_set(authReqMask, bit);
1181 return initiator_key_dist;
1194 return responder_key_dist;
1198 return "SMPPairingMsg";
1203 return "iocap "+
to_string(getIOCapability())+
1205 ", auth_req "+
to_string(getAuthReqMask())+
1207 ", key_dist[init "+
to_string(getInitKeyDist())+
1283 return "SMPPairConfirm";
1379 return "SMPPairRand";
1407 PASSKEY_ENTRY_FAILED = 0x01,
1408 OOB_NOT_AVAILABLE = 0x02,
1409 AUTHENTICATION_REQUIREMENTS = 0x03,
1410 CONFIRM_VALUE_FAILED = 0x04,
1411 PAIRING_NOT_SUPPORTED = 0x05,
1412 ENCRYPTION_KEY_SIZE = 0x06,
1413 COMMON_NOT_SUPPORTED = 0x07,
1414 UNSPECIFIED_REASON = 0x08,
1416 INVALID_PARAMTERS = 0x0A,
1417 DHKEY_CHECK_FAILED = 0x0B,
1418 NUMERIC_COMPARISON_FAILED = 0x0C,
1419 BREDR_PAIRING_IN_PROGRESS = 0x0D,
1420 CROSSXPORT_KEY_DERIGEN_NOT_ALLOWED = 0x0E
1423 return static_cast<uint8_t
>(rhs);
1425 static std::string getReasonCodeString(
const ReasonCode reasonCode)
noexcept;
1450 return "SMPPairFailed";
1516 return "SMPPairPubKey";
1576 return "SMPPairDHKeyCheck";
1606 PASSKEY_ENTRY_STARTED = 0x00,
1607 PASSKEY_DIGIT_ENTERED = 0x01,
1608 PASSKEY_DIGIT_ERASED = 0x02,
1609 PASSKEY_CLEARED = 0x03,
1610 PASSKEY_ENTRY_COMPLETED = 0x04
1613 return static_cast<uint8_t
>(rhs);
1615 static std::string getTypeCodeString(
const TypeCode tc)
noexcept;
1640 return "SMPPasskeyNotify";
1709 return "SMPEncInfo";
1788 return "SMPMasterIdent";
1860 return "SMPIdentInfo";
1929 return "SMPIdentAddrInfo";
1934 const std::string ats = isStaticRandomAddress() ?
"static-random" :
"public";
1935 return "address["+getAddress().toString()+
", "+ats+
"]";
2000 return "SMPSignInfo";
2040 :
SMPPDUMsg(
Opcode::SECURITY_REQUEST, 1+1), authReqMask(auth_req_mask)
2063 return is_set(authReqMask, bit);
2067 return "SMPSecurityReq";
2072 return "auth_req "+
to_string(getAuthReqMask());
Vol 3, Part H: 3.6.2 Encryption Information message.
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
std::string getName() const noexcept override
constexpr jau::uint128dp_t getLTK() const noexcept
Returns the 128-bit Long Term Key (16 octets)
SMPEncInfoMsg(const jau::uint128dp_t &long_term_key)
SMPEncInfoMsg(const uint8_t *source, const jau::nsize_t length)
std::string valueString() const noexcept override
Tag type to group all SMP messages covering encryption keys, treated as byte stream (all of them).
~SMPEncKeyByteStream() noexcept override=default
SMPEncKeyByteStream(const Opcode opc, const jau::nsize_t size)
Persistent memory, w/ ownership .
SMPEncKeyByteStream(const uint8_t *source, const jau::nsize_t size)
Persistent memory, w/ ownership .
SMPException(std::string const &m, const char *file, int line) noexcept
SMPException(std::string type, std::string const &m, const char *file, int line) noexcept
A thread safe SMP handler associated to one device via one L2CAP connection.
Vol 3, Part H: 3.6.5 Identity Address Information message.
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
constexpr bool isStaticRandomAddress() const noexcept
Returns whether the device address is static random (true) or public (false).
std::string getName() const noexcept override
SMPIdentAddrInfoMsg(const bool addrIsStaticRandom, const EUI48 &addr)
EUI48 getAddress() const noexcept
Returns the device address.
std::string valueString() const noexcept override
SMPIdentAddrInfoMsg(const uint8_t *source, const jau::nsize_t length)
Vol 3, Part H: 3.6.4 Identify Information message.
std::string valueString() const noexcept override
std::string getName() const noexcept override
SMPIdentInfoMsg(const uint8_t *source, const jau::nsize_t length)
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
constexpr jau::uint128dp_t getIRK() const noexcept
Returns the 128-bit Identity Resolving Key (IRK, 16 octets)
SMPIdentInfoMsg(const jau::uint128dp_t &identity_resolving_key)
Vol 3, Part H: 3.6.3 Master Identification message.
constexpr uint16_t getEDIV() const noexcept
Returns the 16-bit EDIV value (2 octets) being distributed.
constexpr uint64_t getRand() const noexcept
Returns the 64-bit Rand value (8 octets) being distributed.
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
std::string getName() const noexcept override
std::string valueString() const noexcept override
SMPMasterIdentMsg(const uint8_t *source, const jau::nsize_t length)
SMPMasterIdentMsg(const uint16_t ediv, const uint64_t &rand)
SMPOpcodeException(std::string const &m, const char *file, int line) noexcept
Handles the Security Manager Protocol (SMP) using Protocol Data Unit (PDU) encoded messages over L2CA...
static std::string getOpcodeString(const Opcode opc) noexcept
virtual ~SMPPDUMsg() noexcept=default
constexpr Opcode getOpcode() const noexcept
SMP Command Codes Vol 3, Part H (SM): 3.3.
jau::POctets pdu
actual received PDU
constexpr uint64_t getTimestamp() const noexcept
virtual std::string getName() const noexcept
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 o...
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.
virtual std::string valueString() const noexcept
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 o...
static constexpr uint8_t number(const Opcode rhs) noexcept
void checkOpcode(const Opcode exp1, const Opcode exp2) const
SMPPDUMsg(const uint8_t *source, const jau::nsize_t size, const jau::nsize_t min_size)
Persistent memory, w/ ownership .
virtual std::string baseString() const noexcept
virtual std::string toString() const noexcept
Opcode
SMP Command Codes Vol 3, Part H (SM): 3.3.
@ PAIRING_KEYPRESS_NOTIFICATION
@ IDENTITY_ADDRESS_INFORMATION
SMPPDUMsg(const Opcode opc, const jau::nsize_t size)
Persistent memory, w/ ownership .
SMPPDUMsg(const uint8_t *source, const jau::nsize_t size)
Persistent memory, w/ ownership .
constexpr jau::nsize_t getDataOffset() const noexcept
Returns the octet offset to the data segment in this PDU including the mandatory opcode,...
uint64_t ts_creation
creation timestamp in milliseconds
void checkOpcode(const Opcode expected) const
static T * clone(const T &source) noexcept
Clone template for convenience, based on derived class's copy-constructor.
SMPPacketException(std::string const &m, const char *file, int line) noexcept
Vol 3, Part H: 3.5.3 Pairing Confirm message.
std::string valueString() const noexcept override
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
constexpr jau::uint128dp_t getConfirmValue() const noexcept
Returns the 128-bit Confirm value (16 octets)
SMPPairConfirmMsg(const uint8_t *source, const jau::nsize_t length)
SMPPairConfirmMsg(const jau::uint128dp_t &confirm_value)
std::string getName() const noexcept override
Vol 3, Part H: 3.5.7 Pairing DHKey Check message.
constexpr jau::uint128dp_t getDHKeyCheck() const noexcept
Returns the 128-bit DHKey Check value (16 octets)
std::string valueString() const noexcept override
SMPPairDHKeyCheckMsg(const jau::uint128dp_t &dhkey_check_values)
SMPPairDHKeyCheckMsg(const uint8_t *source, const jau::nsize_t length)
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
std::string getName() const noexcept override
Vol 3, Part H: 3.5.5 Pairing Failed message.
static constexpr uint8_t number(const ReasonCode rhs) noexcept
std::string valueString() const noexcept override
SMPPairFailedMsg(const uint8_t *source, const jau::nsize_t length)
SMPPairFailedMsg(const ReasonCode rc)
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
constexpr ReasonCode getReasonCode() const noexcept
std::string getName() const noexcept override
Vol 3, Part H: 3.5.6 Pairing Public Key message.
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
SMPPairPubKeyMsg(const jau::uint256dp_t &pub_key_x, const jau::uint256dp_t &pub_key_y)
std::string valueString() const noexcept override
constexpr jau::uint256dp_t getPubKeyY() const noexcept
Returns the 256-bit Public Key Y value (32 octets)
SMPPairPubKeyMsg(const uint8_t *source, const jau::nsize_t length)
constexpr jau::uint256dp_t getPubKeyX() const noexcept
Returns the 256-bit Public Key X value (32 octets)
std::string getName() const noexcept override
Vol 3, Part H: 3.5.4 Pairing Random message.
SMPPairRandMsg(const uint8_t *source, const jau::nsize_t length)
constexpr jau::uint128dp_t getRand() const noexcept
Returns the 128-bit Random value (16 octets)
SMPPairRandMsg(const jau::uint128dp_t &random_value)
std::string getName() const noexcept override
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
std::string valueString() const noexcept override
Vol 3, Part H: 3.5.1 Pairing Request message.
constexpr SMPAuthReqs getAuthReqMask() const noexcept
Returns the Authentication Requirements mask.
constexpr SMPKeyType getInitKeyDist() const noexcept
Returns the Initiator Key Distribution field, which defines which keys the initiator shall distribute...
SMPPairingMsg(const bool request_, const uint8_t *source, const jau::nsize_t length)
constexpr bool isAuthRequirementBitSet(const SMPAuthReqs bit) const noexcept
std::string valueString() const noexcept override
constexpr SMPKeyType getRespKeyDist() const noexcept
Return the Responder Key Distribution field, which defines which keys the responder shall distribute ...
constexpr SMPIOCapability getIOCapability() const noexcept
Returns the IO capability bit field.
std::string getName() const noexcept override
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
constexpr uint8_t getMaxEncryptionKeySize() const noexcept
This value defines the maximum encryption key size in octets that the device can support.
SMPPairingMsg(const bool request_, const SMPIOCapability ioc, const SMPOOBDataFlag odf, const SMPAuthReqs auth_req_mask, const uint8_t maxEncKeySize, const SMPKeyType initiator_key_dist_, const SMPKeyType responder_key_dist_)
constexpr SMPOOBDataFlag getOOBDataFlag() const noexcept
Returns the OBB authenticate data flag.
Vol 3, Part H: 3.5.8 Passkey Entry: Keypress notification messages.
static constexpr uint8_t number(const TypeCode rhs) noexcept
std::string getName() const noexcept override
constexpr TypeCode getTypeCode() const noexcept
std::string valueString() const noexcept override
SMPPasskeyNotification(const TypeCode tc)
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
SMPPasskeyNotification(const uint8_t *source, const jau::nsize_t length)
Vol 3, Part H: 3.6.7 Security Request message.
constexpr SMPAuthReqs getAuthReqMask() const noexcept
Returns the SMPPairingMsg::AuthRequirements (1 octet)
SMPSecurityReqMsg(const uint8_t *source, const jau::nsize_t length)
SMPSecurityReqMsg(const SMPAuthReqs auth_req_mask)
std::string getName() const noexcept override
std::string valueString() const noexcept override
constexpr bool isAuthRequirementBitSet(const SMPAuthReqs bit) const noexcept
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
Vol 3, Part H: 3.6.6 Signing Information message.
constexpr_cxx20 jau::nsize_t getDataSize() const noexcept override
Returns the required data size according to the specified packet, which should be within 0-22 or 64 o...
std::string getName() const noexcept override
SMPSignInfoMsg(const uint8_t *source, const jau::nsize_t length)
std::string valueString() const noexcept override
SMPSignInfoMsg(const jau::uint128dp_t &signature_key)
constexpr jau::uint128dp_t getCSRK() const noexcept
Returns the 128-bit Connection Signature Resolving Key (CSRK, 16 octets)
SMPValueException(std::string const &m, const char *file, int line) noexcept
Persistent endian aware octet data, i.e.
RuntimeException(std::string type, std::string const &m, const char *file, int line) noexcept
void put_eui48(const nsize_t i, const EUI48 &v)
constexpr void put_uint8_nc(const nsize_t i, const uint8_t v) noexcept
uint8_t * get_wptr() noexcept
void put_uint8(const nsize_t i, const uint8_t v)
constexpr uint16_t get_uint16_nc(const nsize_t i) const noexcept
constexpr nsize_t size() const noexcept
Returns the used memory size for read and write operations, may be zero.
EUI48 get_eui48_nc(const nsize_t i) const noexcept
void check_range(const nsize_t i, const nsize_t count, const char *file, int line) const
constexpr uint8_t get_uint8_nc(const nsize_t i) const noexcept
constexpr uint8_t const * get_ptr() const noexcept
constexpr uint8_t const * get_ptr_nc(const nsize_t i) const noexcept
static bool matches(const BTDeviceRef &device)
constexpr uint128dp_t get_uint128(uint8_t const *buffer) noexcept
See get_uint16() for reference.
constexpr void put_uint256(uint8_t *buffer, const uint256dp_t &v) noexcept
See put_uint16() for reference.
constexpr uint16_t get_uint16(uint8_t const *buffer) noexcept
Returns a uint16_t value from the given byte address using packed_t to resolve a potential memory ali...
constexpr uint256dp_t get_uint256(uint8_t const *buffer) noexcept
See get_uint16() for reference.
lb_endian_t
Simplified reduced endian type only covering little- and big-endian.
constexpr void put_uint64(uint8_t *buffer, const uint64_t &v) noexcept
See put_uint16() for reference.
constexpr void put_uint16(uint8_t *buffer, const uint16_t v) noexcept
Put the given uint16_t value into the given byte address using packed_t to resolve a potential memory...
constexpr void put_uint128(uint8_t *buffer, const uint128dp_t &v) noexcept
See put_uint16() for reference.
constexpr uint64_t get_uint64(uint8_t const *buffer) noexcept
See get_uint16() for reference.
#define constexpr_cxx20
constexpr qualifier replacement for C++20 constexpr.
constexpr bool hasSMPPairingFinished(const SMPPairingState state) noexcept
Returns true if the given SMPPairingState indicates a finished pairing process, i....
constexpr bool hasSMPIOCapabilityFullInput(const SMPIOCapability ioc) noexcept
SMPAuthReqs
SMP Authentication Requirements Bits, denotes specific bits or whole protocol uint8_t bit-mask.
constexpr bool isSMPPairingAllowingInput(const SMPPairingState state, const SMPPairingState inputSpec) noexcept
Returns true if the given SMPPairingState indicates a pairing process waiting for user input,...
SMPPairingState
SMP Pairing Process state definition.
constexpr bool isSMPPairingUserInteraction(const SMPPairingState state) noexcept
Returns true if the given SMPPairingState indicates expected user interaction, i.e.
constexpr bool isSMPPairingActive(const SMPPairingState state) noexcept
Returns true if the given SMPPairingState indicates an active pairing process, i.e.
constexpr SMPKeyType & operator&=(SMPKeyType &store, const SMPKeyType &rhs) noexcept
constexpr SMPKeyType & operator^=(SMPKeyType &store, const SMPKeyType &rhs) noexcept
SMPKeyType
SMP Key Type for Distribution, indicates keys distributed in the Transport Specific Key Distribution ...
constexpr bool hasSMPIOCapabilityAnyIO(const SMPIOCapability ioc) noexcept
std::string toPassKeyString(const std::uint32_t passKey) noexcept
Returns given passKey ranging [0..999999] as a canonical string, e.g.
constexpr SMPKeyType & operator|=(SMPKeyType &store, const SMPKeyType &rhs) noexcept
std::string to_String(const SMPLongTermKey <k) noexcept
constexpr SMPIOCapability to_SMPIOCapability(const uint8_t v) noexcept
SMPOOBDataFlag
Vol 3, Part H, 2.3.3 OOB authentication data.
SMPIOCapability
Vol 3, Part H, 2.3.2 IO capabilities.
std::string to_string(const SMPKeyType mask) noexcept
PairingMode getPairingMode(const bool use_sc, const SMPAuthReqs authReqs_ini, const SMPIOCapability ioCap_ini, const SMPOOBDataFlag oobFlag_ini, const SMPAuthReqs authReqs_res, const SMPIOCapability ioCap_res, const SMPOOBDataFlag oobFlag_res) noexcept
Returns the PairingMode derived from both devices' sets of SMPAuthReqs, SMPIOCapability and SMPOOBDat...
constexpr bool hasSMPIOCapabilityBinaryInput(const SMPIOCapability ioc) noexcept
@ SECURE_CONNECTIONS
If LE Secure Connections pairing is supported by the device, then the SC field shall be set to 1,...
@ RFU_2
Reserved for future use.
@ MITM
A device sets the MITM flag to one to request an Authenticated security property for the STK when usi...
@ BONDING
Indicate bonding being requested by the initiating device.
@ BONDING_RFU
Reserved for future use.
@ KEYPRESS
The keypress field is used only in the Passkey Entry protocol and shall be ignored in other protocols...
@ CT2_H7_FUNC_SUPPORT
The CT2 field shall be set to 1 upon transmission to indicate support for the h7 function.
@ RFU_1
Reserved for future use.
@ OOB_EXPECTED
Phase 2: Authentication (MITM) OOB data expected now, see PairingMode::OUT_OF_BAND.
@ REQUESTED_BY_RESPONDER
Phase 0: Pairing requested by responding (slave) device via SMPSecurityReqMsg.
@ PASSKEY_NOTIFY
Phase 2: Authentication (MITM) PASSKEY (produced by this responder adapter, acting as peripheral GATT...
@ COMPLETED
Phase 3: Key & value distribution completed by responding (slave) device sending SMPIdentInfoMsg (#1)...
@ NUMERIC_COMPARE_EXPECTED
Phase 2: Authentication (MITM) Numeric Comparison Reply expected now, see PairingMode::NUMERIC_COMPAR...
@ NONE
No pairing in process.
@ PASSKEY_EXPECTED
Phase 2: Authentication (MITM) PASSKEY expected now, see PairingMode::PASSKEY_ENTRY_ini.
@ FEATURE_EXCHANGE_STARTED
Phase 1: Pairing requested by initiating (master) device via SMPPairingMsg.
@ FEATURE_EXCHANGE_COMPLETED
Phase 1: Pairing responded by responding (slave) device via SMPPairingMsg.
@ KEY_DISTRIBUTION
Phase 3: Key & value distribution started after SMPPairConfirmMsg or SMPPairPubKeyMsg (LE Secure Conn...
@ LINK_KEY
SMP on the LE transport: Indicate that the device would like to derive the Link Key from the LTK.
@ RFU_4
Reserved for future use.
@ SIGN_KEY
Indicates that the device shall distribute CSRK using the Signing Information command.
@ ENC_KEY
LE legacy pairing: Indicates device shall distribute LTK using the Encryption Information command,...
@ ID_KEY
Indicates that the device shall distribute IRK using the Identity Information command followed by its...
@ RFU_3
Reserved for future use.
@ OOB_AUTH_DATA_REMOTE_PRESENT
OOB_AUTH_DATA_REMOTE_PRESENT.
@ OOB_AUTH_DATA_NOT_PRESENT
OOB_AUTH_DATA_NOT_PRESENT.
@ KEYBOARD_ONLY
Keyboard input only, value 2.
@ UNSET
Denoting unset value, i.e.
@ NO_INPUT_NO_OUTPUT
No input not output, value 3.
@ DISPLAY_ONLY
Display output only, value 0.
@ DISPLAY_YES_NO
Display output and boolean confirmation input keys only, value 1.
@ KEYBOARD_DISPLAY
Display output and keyboard input, value 4.
@ SMP_TIMEOUT_MS
SMP Timeout Vol 3, Part H (SM): 3.4.
constexpr LE_Features operator^(const LE_Features lhs, const LE_Features rhs) noexcept
bool operator==(const BTAdapter &lhs, const BTAdapter &rhs) noexcept
void clear() noexcept
Clears internal list.
std::string to_string(const DiscoveryPolicy v) noexcept
constexpr ScanType operator~(const ScanType val) noexcept
PairingMode
Bluetooth secure pairing mode.
bool operator!=(const BTAdapter &lhs, const BTAdapter &rhs) noexcept
constexpr bool is_set(const LE_Features mask, const LE_Features bit) noexcept
constexpr uint8_t number(const DiscoveryPolicy rhs) noexcept
@ UNDEFINED
Undefined, e.g.
@ UNSET
Security Level not set, value 0.
constexpr BTGattChar::PropertyBitVal operator&(const BTGattChar::PropertyBitVal lhs, const BTGattChar::PropertyBitVal rhs) noexcept
constexpr BTGattChar::PropertyBitVal operator|(const BTGattChar::PropertyBitVal lhs, const BTGattChar::PropertyBitVal rhs) noexcept
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
constexpr T max(const T x, const T y) noexcept
Returns the maximum of two integrals (w/ branching) in O(1)
std::string bytesHexString(const void *data, const nsize_t offset, const nsize_t length, const bool lsbFirst, const bool lowerCase=true) noexcept
Produce a hexadecimal string representation of the given byte values.
std::string to_hexstring(value_type const &v) noexcept
Produce a lower-case hexadecimal string representation of the given pointer.
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
uint64_t getCurrentMilliseconds() noexcept
Returns current monotonic time in milliseconds.
SMP Identity Resolving Key, used for platform agnostic persistence.
SMP Long Term Key, used for platform agnostic persistence.
SMP Signature Resolving Key, used for platform agnostic persistence.
A packed 48 bit EUI-48 identifier, formerly known as MAC-48 or simply network device MAC address (Med...
std::string toString() const noexcept
A 128-bit packed uint8_t data array.
A 256-bit packed uint8_t data array.