diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/direct_bt/BTDevice.cpp | 4 | ||||
-rw-r--r-- | src/direct_bt/SMPTypes.cpp | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/direct_bt/BTDevice.cpp b/src/direct_bt/BTDevice.cpp index ee29d2e0..5a902215 100644 --- a/src/direct_bt/BTDevice.cpp +++ b/src/direct_bt/BTDevice.cpp @@ -1207,8 +1207,8 @@ void BTDevice::hciSMPMsgCallback(std::shared_ptr<BTDevice> sthis, const SMPPDUMs pairing_data.keys_init_exp = msg1.getInitKeyDist(); // responding device overrides initiator's request! pairing_data.keys_resp_exp = msg1.getRespKeyDist(); - const bool use_sc = isSMPAuthReqBitSet( pairing_data.authReqs_init, SMPAuthReqs::SECURE_CONNECTIONS ) && - isSMPAuthReqBitSet( pairing_data.authReqs_resp, SMPAuthReqs::SECURE_CONNECTIONS ); + const bool use_sc = is_set( pairing_data.authReqs_init, SMPAuthReqs::SECURE_CONNECTIONS ) && + is_set( pairing_data.authReqs_resp, SMPAuthReqs::SECURE_CONNECTIONS ); pairing_data.use_sc = use_sc; pmode = ::getPairingMode(use_sc, diff --git a/src/direct_bt/SMPTypes.cpp b/src/direct_bt/SMPTypes.cpp index b1b8ed50..8c3b190d 100644 --- a/src/direct_bt/SMPTypes.cpp +++ b/src/direct_bt/SMPTypes.cpp @@ -88,42 +88,42 @@ std::string direct_bt::to_string(const SMPOOBDataFlag v) noexcept { std::string direct_bt::to_string(const SMPAuthReqs mask) noexcept { std::string out("["); - if( isSMPAuthReqBitSet(mask, SMPAuthReqs::BONDING) ) { + if( is_set(mask, SMPAuthReqs::BONDING) ) { out.append("Bonding"); } else { out.append("No bonding"); } - if( isSMPAuthReqBitSet(mask, SMPAuthReqs::BONDING_RFU) ) { + if( is_set(mask, SMPAuthReqs::BONDING_RFU) ) { out.append(", "); out.append("Bonding Reserved"); } out.append(", "); - if( isSMPAuthReqBitSet(mask, SMPAuthReqs::MITM) ) { + if( is_set(mask, SMPAuthReqs::MITM) ) { out.append("MITM"); } else { out.append("No MITM"); } out.append(", "); - if( isSMPAuthReqBitSet(mask, SMPAuthReqs::SECURE_CONNECTIONS) ) { + if( is_set(mask, SMPAuthReqs::SECURE_CONNECTIONS) ) { out.append("SC"); } else { out.append("Legacy"); } out.append(", "); - if( isSMPAuthReqBitSet(mask, SMPAuthReqs::KEYPRESS) ) { + if( is_set(mask, SMPAuthReqs::KEYPRESS) ) { out.append("Keypresses"); } else { out.append("No keypresses"); } - if( isSMPAuthReqBitSet(mask, SMPAuthReqs::CT2_H7_FUNC_SUPPORT) ) { + if( is_set(mask, SMPAuthReqs::CT2_H7_FUNC_SUPPORT) ) { out.append(", "); out.append("CT2_H7"); } - if( isSMPAuthReqBitSet(mask, SMPAuthReqs::RFU_1) ) { + if( is_set(mask, SMPAuthReqs::RFU_1) ) { out.append(", "); out.append("RFU_1"); } - if( isSMPAuthReqBitSet(mask, SMPAuthReqs::RFU_2) ) { + if( is_set(mask, SMPAuthReqs::RFU_2) ) { out.append(", "); out.append("RFU_2"); } @@ -149,8 +149,8 @@ PairingMode direct_bt::getPairingMode(const bool use_sc, } // Authenticated via IOCapabilities, if any of them has requested MITM - if( isSMPAuthReqBitSet( authReqs_ini, SMPAuthReqs::MITM ) || - isSMPAuthReqBitSet( authReqs_res, SMPAuthReqs::MITM ) ) + if( is_set( authReqs_ini, SMPAuthReqs::MITM ) || + is_set( authReqs_res, SMPAuthReqs::MITM ) ) { return getPairingMode(use_sc, ioCap_ini, ioCap_res); } @@ -170,8 +170,8 @@ PairingMode direct_bt::getPairingMode(const bool use_sc, } // Authenticated via IOCapabilities, if any of them has requested MITM - if( isSMPAuthReqBitSet( authReqs_ini, SMPAuthReqs::MITM ) || - isSMPAuthReqBitSet( authReqs_res, SMPAuthReqs::MITM ) ) + if( is_set( authReqs_ini, SMPAuthReqs::MITM ) || + is_set( authReqs_res, SMPAuthReqs::MITM ) ) { return getPairingMode(use_sc, ioCap_ini, ioCap_res); } |