diff options
author | Sven Gothel <[email protected]> | 2022-06-16 06:34:19 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-06-16 06:34:19 +0200 |
commit | d7de99dbf5d0941bcab36f49fd1871435f977fc3 (patch) | |
tree | b18948235bcf5cfb69de720e5964cf7ac11d6c17 /src | |
parent | 89261edc4bea1a7dbbfc6f28a678b4292350dac5 (diff) |
C++: Shorten is*Set() -> is_set() and set*() -> set() for bit-type enums; Fix is_set() bit-type enum: '0 != ( mask & bit )' -> 'bit == ( mask & bit )'
Diffstat (limited to 'src')
-rw-r--r-- | src/direct_bt/BTAdapter.cpp | 18 | ||||
-rw-r--r-- | src/direct_bt/BTDevice.cpp | 10 | ||||
-rw-r--r-- | src/direct_bt/BTTypes0.cpp | 58 | ||||
-rw-r--r-- | src/direct_bt/HCIHandler.cpp | 18 |
4 files changed, 52 insertions, 52 deletions
diff --git a/src/direct_bt/BTAdapter.cpp b/src/direct_bt/BTAdapter.cpp index b5f84439..8eb369d6 100644 --- a/src/direct_bt/BTAdapter.cpp +++ b/src/direct_bt/BTAdapter.cpp @@ -1030,7 +1030,7 @@ void BTAdapter::checkDiscoveryState() noexcept { const ScanType currentNativeScanType = hci.getCurrentScanType(); // Check LE scan state if( DiscoveryPolicy::AUTO_OFF == discovery_policy ) { - if( hasScanType(currentMetaScanType, ScanType::LE) != hasScanType(currentNativeScanType, ScanType::LE) ) { + if( is_set(currentMetaScanType, ScanType::LE) != is_set(currentNativeScanType, ScanType::LE) ) { std::string msg("Invalid DiscoveryState: policy "+to_string(discovery_policy)+ ", currentScanType*[native "+ to_string(currentNativeScanType)+" != meta "+ @@ -1039,7 +1039,7 @@ void BTAdapter::checkDiscoveryState() noexcept { // ABORT? } } else { - if( !hasScanType(currentMetaScanType, ScanType::LE) && hasScanType(currentNativeScanType, ScanType::LE) ) { + if( !is_set(currentMetaScanType, ScanType::LE) && is_set(currentNativeScanType, ScanType::LE) ) { std::string msg("Invalid DiscoveryState: policy "+to_string(discovery_policy)+ ", currentScanType*[native "+ to_string(currentNativeScanType)+", meta "+ @@ -1081,7 +1081,7 @@ HCIStatusCode BTAdapter::startDiscovery(const DiscoveryPolicy policy, const bool const ScanType currentNativeScanType = hci.getCurrentScanType(); - if( hasScanType(currentNativeScanType, ScanType::LE) ) { + if( is_set(currentNativeScanType, ScanType::LE) ) { btRole = BTRole::Master; if( discovery_policy == policy ) { DBG_PRINT("BTAdapter::startDiscovery: Already discovering, unchanged policy %s -> %s, currentScanType[native %s, meta %s] ...\n- %s", @@ -1138,7 +1138,7 @@ void BTAdapter::startDiscoveryBackground() noexcept { const std::lock_guard<std::mutex> lock(mtx_discovery); // RAII-style acquire and relinquish via destructor const ScanType currentNativeScanType = hci.getCurrentScanType(); - if( !hasScanType(currentNativeScanType, ScanType::LE) && + if( !is_set(currentNativeScanType, ScanType::LE) && DiscoveryPolicy::AUTO_OFF != discovery_policy && !hasDevicesPausingDiscovery() ) // still required to start discovery ??? { @@ -1197,8 +1197,8 @@ HCIStatusCode BTAdapter::stopDiscoveryImpl(const bool forceDiscoveringEvent, con * [4] current -> [5] post stopDiscovery == sendEvent */ const ScanType currentNativeScanType = hci.getCurrentScanType(); - const bool le_scan_temp_disabled = hasScanType(currentMetaScanType, ScanType::LE) && // true - !hasScanType(currentNativeScanType, ScanType::LE) && // false + const bool le_scan_temp_disabled = is_set(currentMetaScanType, ScanType::LE) && // true + !is_set(currentNativeScanType, ScanType::LE) && // false DiscoveryPolicy::AUTO_OFF != discovery_policy; // true DBG_PRINT("BTAdapter::stopDiscovery: Start: policy %s, currentScanType[native %s, meta %s], le_scan_temp_disabled %d, forceDiscEvent %d ...", @@ -1210,7 +1210,7 @@ HCIStatusCode BTAdapter::stopDiscoveryImpl(const bool forceDiscoveringEvent, con discovery_policy = DiscoveryPolicy::AUTO_OFF; } - if( !hasScanType(currentMetaScanType, ScanType::LE) ) { + if( !is_set(currentMetaScanType, ScanType::LE) ) { DBG_PRINT("BTAdapter::stopDiscovery: Already disabled, policy %s, currentScanType[native %s, meta %s] ...", to_string(discovery_policy).c_str(), to_string(currentNativeScanType).c_str(), to_string(currentMetaScanType).c_str()); @@ -1665,7 +1665,7 @@ bool BTAdapter::mgmtEvDeviceDiscoveringAny(const ScanType eventScanType, const b nextMetaScanType = changeScanType(currentMetaScanType, eventScanType, true); } else { // disabled eventScanType - if( hasScanType(eventScanType, ScanType::LE) && DiscoveryPolicy::AUTO_OFF != discovery_policy ) { + if( is_set(eventScanType, ScanType::LE) && DiscoveryPolicy::AUTO_OFF != discovery_policy ) { // Unchanged meta for disabled-LE && keep_le_scan_alive nextMetaScanType = currentMetaScanType; } else { @@ -1707,7 +1707,7 @@ bool BTAdapter::mgmtEvDeviceDiscoveringAny(const ScanType eventScanType, const b i++; }); - if( !hasScanType(currentNativeScanType, ScanType::LE) && + if( !is_set(currentNativeScanType, ScanType::LE) && DiscoveryPolicy::AUTO_OFF != discovery_policy && !hasDevicesPausingDiscovery() ) { diff --git a/src/direct_bt/BTDevice.cpp b/src/direct_bt/BTDevice.cpp index 1f89018d..ee29d2e0 100644 --- a/src/direct_bt/BTDevice.cpp +++ b/src/direct_bt/BTDevice.cpp @@ -242,12 +242,12 @@ EIRDataType BTDevice::update(GattGenericAccessSvc const &data, const uint64_t ti if( 0 == name.length() && data.deviceName.length() > 0 ) { name = data.deviceName; eir_new->setName( name ); - setEIRDataTypeSet(res, EIRDataType::NAME); + set(res, EIRDataType::NAME); mod = true; } if( eir_new->getAppearance() != data.appearance && AppearanceCat::UNKNOWN != data.appearance) { eir_new->setAppearance( data.appearance ); - setEIRDataTypeSet(res, EIRDataType::APPEARANCE); + set(res, EIRDataType::APPEARANCE); mod = true; } if( mod ) { @@ -271,11 +271,11 @@ std::shared_ptr<ConnectionInfo> BTDevice::getConnectionInfo() noexcept { EIRDataType updateMask = EIRDataType::NONE; if( rssi != connInfo->getRSSI() ) { rssi = connInfo->getRSSI(); - setEIRDataTypeSet(updateMask, EIRDataType::RSSI); + set(updateMask, EIRDataType::RSSI); } if( tx_power != connInfo->getTxPower() ) { tx_power = connInfo->getTxPower(); - setEIRDataTypeSet(updateMask, EIRDataType::TX_POWER); + set(updateMask, EIRDataType::TX_POWER); } if( EIRDataType::NONE != updateMask ) { std::shared_ptr<BTDevice> sharedInstance = getSharedInstance(); @@ -602,7 +602,7 @@ void BTDevice::processL2CAPSetup(std::shared_ptr<BTDevice> sthis) { const SMPIOCapability io_cap_conn = pairing_data.ioCap_conn; BTSecurityLevel sec_level { BTSecurityLevel::UNSET }; - const bool responderLikesEncryption = pairing_data.res_requested_sec || isLEFeaturesBitSet(le_features, LE_Features::LE_Encryption); + const bool responderLikesEncryption = pairing_data.res_requested_sec || is_set(le_features, LE_Features::LE_Encryption); if( BTSecurityLevel::UNSET != sec_level_user ) { sec_level = sec_level_user; } else if( responderLikesEncryption && SMPIOCapability::UNSET != io_cap_conn ) { diff --git a/src/direct_bt/BTTypes0.cpp b/src/direct_bt/BTTypes0.cpp index 14a11c18..80c21470 100644 --- a/src/direct_bt/BTTypes0.cpp +++ b/src/direct_bt/BTTypes0.cpp @@ -705,62 +705,62 @@ EIRDataType EInfoReport::set(const EInfoReport& eir) noexcept { if( eir.isSet( EIRDataType::EVT_TYPE ) ) { if( !isSet( EIRDataType::EVT_TYPE ) || getEvtType() != eir.getEvtType() ) { setEvtType(eir.getEvtType()); - setEIRDataTypeSet(res, EIRDataType::EVT_TYPE); + direct_bt::set(res, EIRDataType::EVT_TYPE); } } if( eir.isSet( EIRDataType::EXT_EVT_TYPE ) ) { if( !isSet( EIRDataType::EXT_EVT_TYPE ) || getExtEvtType() != eir.getExtEvtType() ) { setExtEvtType(eir.getExtEvtType()); - setEIRDataTypeSet(res, EIRDataType::EXT_EVT_TYPE); + direct_bt::set(res, EIRDataType::EXT_EVT_TYPE); } } if( eir.isSet( EIRDataType::BDADDR_TYPE ) ) { if( !isSet( EIRDataType::BDADDR_TYPE ) || getAddressType() != eir.getAddressType() ) { setAddressType(eir.getAddressType()); - setEIRDataTypeSet(res, EIRDataType::BDADDR_TYPE); + direct_bt::set(res, EIRDataType::BDADDR_TYPE); } } if( eir.isSet( EIRDataType::BDADDR ) ) { if( !isSet( EIRDataType::BDADDR ) || getAddress() != eir.getAddress() ) { setAddress(eir.getAddress()); - setEIRDataTypeSet(res, EIRDataType::BDADDR); + direct_bt::set(res, EIRDataType::BDADDR); } } if( eir.isSet( EIRDataType::RSSI ) ) { if( !isSet( EIRDataType::RSSI ) || getRSSI() != eir.getRSSI() ) { setRSSI(eir.getRSSI()); - setEIRDataTypeSet(res, EIRDataType::RSSI); + direct_bt::set(res, EIRDataType::RSSI); } } if( eir.isSet( EIRDataType::TX_POWER ) ) { if( !isSet( EIRDataType::TX_POWER ) || getTxPower() != eir.getTxPower() ) { setTxPower(eir.getTxPower()); - setEIRDataTypeSet(res, EIRDataType::TX_POWER); + direct_bt::set(res, EIRDataType::TX_POWER); } } if( eir.isSet( EIRDataType::FLAGS ) ) { if( !isSet( EIRDataType::FLAGS ) || getFlags() != eir.getFlags() ) { addFlags(eir.getFlags()); - setEIRDataTypeSet(res, EIRDataType::FLAGS); + direct_bt::set(res, EIRDataType::FLAGS); } } if( eir.isSet( EIRDataType::NAME) ) { if( !isSet( EIRDataType::NAME ) || getName() != eir.getName() ) { setName(eir.getName()); - setEIRDataTypeSet(res, EIRDataType::NAME); + direct_bt::set(res, EIRDataType::NAME); } } if( eir.isSet( EIRDataType::NAME_SHORT) ) { if( !isSet( EIRDataType::NAME_SHORT ) || getShortName() != eir.getShortName() ) { setShortName(eir.getShortName()); - setEIRDataTypeSet(res, EIRDataType::NAME_SHORT); + direct_bt::set(res, EIRDataType::NAME_SHORT); } } if( eir.isSet( EIRDataType::MANUF_DATA) ) { std::shared_ptr<ManufactureSpecificData> o_msd = eir.getManufactureSpecificData(); if( nullptr != o_msd && ( !isSet( EIRDataType::MANUF_DATA ) || nullptr == getManufactureSpecificData() || *getManufactureSpecificData() != *o_msd ) ) { setManufactureSpecificData(*o_msd); - setEIRDataTypeSet(res, EIRDataType::MANUF_DATA); + direct_bt::set(res, EIRDataType::MANUF_DATA); } } if( eir.isSet( EIRDataType::SERVICE_UUID) ) { @@ -772,31 +772,31 @@ EIRDataType EInfoReport::set(const EInfoReport& eir) noexcept { } if( added ) { setServicesComplete(eir.getServicesComplete()); - setEIRDataTypeSet(res, EIRDataType::SERVICE_UUID); + direct_bt::set(res, EIRDataType::SERVICE_UUID); } } if( eir.isSet( EIRDataType::DEVICE_CLASS) ) { if( !isSet( EIRDataType::DEVICE_CLASS ) || getDeviceClass() != eir.getDeviceClass() ) { setDeviceClass(eir.getDeviceClass()); - setEIRDataTypeSet(res, EIRDataType::DEVICE_CLASS); + direct_bt::set(res, EIRDataType::DEVICE_CLASS); } } if( eir.isSet( EIRDataType::APPEARANCE) ) { if( !isSet( EIRDataType::APPEARANCE ) || getAppearance() != eir.getAppearance() ) { setAppearance(eir.getAppearance()); - setEIRDataTypeSet(res, EIRDataType::APPEARANCE); + direct_bt::set(res, EIRDataType::APPEARANCE); } } if( eir.isSet( EIRDataType::HASH) ) { if( !isSet( EIRDataType::HASH ) || getHash() != eir.getHash() ) { setHash(eir.getHash().get_ptr()); - setEIRDataTypeSet(res, EIRDataType::HASH); + direct_bt::set(res, EIRDataType::HASH); } } if( eir.isSet( EIRDataType::RANDOMIZER) ) { if( !isSet( EIRDataType::RANDOMIZER ) || getRandomizer() != eir.getRandomizer() ) { setRandomizer(eir.getRandomizer().get_ptr()); - setEIRDataTypeSet(res, EIRDataType::RANDOMIZER); + direct_bt::set(res, EIRDataType::RANDOMIZER); } } if( eir.isSet( EIRDataType::DEVICE_ID) ) { @@ -806,7 +806,7 @@ EIRDataType EInfoReport::set(const EInfoReport& eir) noexcept { did_source != source_ || did_vendor != vendor_ || did_product != product_ || did_version != version_ ) { setDeviceID(source_, vendor_, product_, version_); - setEIRDataTypeSet(res, EIRDataType::DEVICE_ID); + direct_bt::set(res, EIRDataType::DEVICE_ID); } } if( eir.isSet( EIRDataType::CONN_IVAL) ) { @@ -814,7 +814,7 @@ EIRDataType EInfoReport::set(const EInfoReport& eir) noexcept { eir.getConnInterval(min, max); if( !isSet( EIRDataType::CONN_IVAL ) || conn_interval_min != min || conn_interval_max != max ) { setConnInterval(min, max); - setEIRDataTypeSet(res, EIRDataType::CONN_IVAL); + direct_bt::set(res, EIRDataType::CONN_IVAL); } } if( EIRDataType::NONE != res ) { @@ -1229,7 +1229,7 @@ jau::nsize_t EInfoReport::write_data(EIRDataType write_mask, uint8_t * data, jau uint8_t * data_i = data; const EIRDataType mask = write_mask & eir_data_mask; - if( isEIRDataTypeSet(mask, EIRDataType::FLAGS) ) { + if( is_set(mask, EIRDataType::FLAGS) ) { const jau::nsize_t ad_sz = 2; if( ( count + 1 + ad_sz ) > data_length ) { _WARN_OOB("FLAGS"); @@ -1240,7 +1240,7 @@ jau::nsize_t EInfoReport::write_data(EIRDataType write_mask, uint8_t * data, jau *data_i++ = direct_bt::number( GAP_T::FLAGS ); *data_i++ = direct_bt::number( getFlags() ); } - if( isEIRDataTypeSet(mask, EIRDataType::NAME) ) { + if( is_set(mask, EIRDataType::NAME) ) { const jau::nsize_t ad_sz = 1 + name.size(); if( ( count + 1 + ad_sz ) > data_length ) { _WARN_OOB("NAME"); @@ -1251,7 +1251,7 @@ jau::nsize_t EInfoReport::write_data(EIRDataType write_mask, uint8_t * data, jau *data_i++ = direct_bt::number( GAP_T::NAME_LOCAL_COMPLETE ); memcpy(data_i, name.c_str(), ad_sz-1); data_i += ad_sz-1; - } else if( isEIRDataTypeSet(mask, EIRDataType::NAME_SHORT) ) { + } else if( is_set(mask, EIRDataType::NAME_SHORT) ) { const jau::nsize_t ad_sz = 1 + name_short.size(); if( ( count + 1 + ad_sz ) > data_length ) { _WARN_OOB("NAME_SHORT"); @@ -1263,7 +1263,7 @@ jau::nsize_t EInfoReport::write_data(EIRDataType write_mask, uint8_t * data, jau memcpy(data_i, name_short.c_str(), ad_sz-1); data_i += ad_sz-1; } - if( isEIRDataTypeSet(mask, EIRDataType::MANUF_DATA) && nullptr != msd ) { + if( is_set(mask, EIRDataType::MANUF_DATA) && nullptr != msd ) { const jau::nsize_t msd_data_sz = msd->getData().size(); const jau::nsize_t ad_sz = 1 + 2 + msd_data_sz; if( ( count + 1 + ad_sz ) > data_length ) { @@ -1280,7 +1280,7 @@ jau::nsize_t EInfoReport::write_data(EIRDataType write_mask, uint8_t * data, jau data_i +=msd_data_sz; } } - if( isEIRDataTypeSet(mask, EIRDataType::SERVICE_UUID) ) { + if( is_set(mask, EIRDataType::SERVICE_UUID) ) { jau::darray<std::shared_ptr<const jau::uuid_t>> uuid16s, uuid32s, uuid128s; for(auto it = services.begin(); it != services.end(); it++) { std::shared_ptr<const jau::uuid_t> p = *it; @@ -1341,7 +1341,7 @@ jau::nsize_t EInfoReport::write_data(EIRDataType write_mask, uint8_t * data, jau } } } - if( isEIRDataTypeSet(mask, EIRDataType::CONN_IVAL) ) { + if( is_set(mask, EIRDataType::CONN_IVAL) ) { const jau::nsize_t ad_sz = 5; if( ( count + 1 + ad_sz ) > data_length ) { _WARN_OOB("CONN_IVAL"); @@ -1354,7 +1354,7 @@ jau::nsize_t EInfoReport::write_data(EIRDataType write_mask, uint8_t * data, jau jau::put_uint16(data_i, 2, conn_interval_max, true /* littleEndian */); data_i += 4; } - if( isEIRDataTypeSet(mask, EIRDataType::TX_POWER) ) { + if( is_set(mask, EIRDataType::TX_POWER) ) { const jau::nsize_t ad_sz = 2; if( ( count + 1 + ad_sz ) > data_length ) { _WARN_OOB("TX_POWER"); @@ -1415,12 +1415,12 @@ EInfoReport::Source EInfoReport::toSource(const AD_PDU_Type type) { } EInfoReport::Source EInfoReport::toSource(const EAD_Event_Type type) { - if( isEAD_Event_TypeSet(type, EAD_Event_Type::CONN_ADV) || - isEAD_Event_TypeSet(type, EAD_Event_Type::SCAN_ADV) || - isEAD_Event_TypeSet(type, EAD_Event_Type::DIR_ADV) ) { + if( is_set(type, EAD_Event_Type::CONN_ADV) || + is_set(type, EAD_Event_Type::SCAN_ADV) || + is_set(type, EAD_Event_Type::DIR_ADV) ) { return Source::AD_IND; } - if( isEAD_Event_TypeSet(type, EAD_Event_Type::SCAN_RSP) ) { + if( is_set(type, EAD_Event_Type::SCAN_RSP) ) { return Source::AD_SCAN_RSP; } return Source::NA; @@ -1548,7 +1548,7 @@ jau::darray<std::unique_ptr<EInfoReport>> EInfoReport::read_ext_ad_reports(uint8 const EAD_Event_Type ead_type = static_cast<EAD_Event_Type>(jau::get_uint16(i_octets, 0, true /* littleEndian */)); ad_reports[i]->setExtEvtType(ead_type); i_octets+=2; - if( isEAD_Event_TypeSet(ead_type, EAD_Event_Type::LEGACY_PDU) ) { + if( is_set(ead_type, EAD_Event_Type::LEGACY_PDU) ) { const AD_PDU_Type ad_type = static_cast<AD_PDU_Type>( ::number(ead_type) ); ad_reports[i]->setEvtType( ad_type ); ad_reports[i]->setSource( toSource( ad_type ), true /* ext */); diff --git a/src/direct_bt/HCIHandler.cpp b/src/direct_bt/HCIHandler.cpp index 6b29a656..b316b6d4 100644 --- a/src/direct_bt/HCIHandler.cpp +++ b/src/direct_bt/HCIHandler.cpp @@ -1089,7 +1089,7 @@ HCIStatusCode HCIHandler::le_set_scan_param(const bool le_scan_active, ERR_PRINT("HCIHandler::le_set_scan_param: Not connected %s", toString().c_str()); return HCIStatusCode::DISCONNECTED; } - if( hasScanType(currentScanType, ScanType::LE) ) { + if( is_set(currentScanType, ScanType::LE) ) { WARN_PRINT("HCIHandler::le_set_scan_param: Not allowed: LE Scan Enabled: %s - tried scan [interval %.3f ms, window %.3f ms]", toString().c_str(), 0.625f * (float)le_scan_interval, 0.625f * (float)le_scan_window); return HCIStatusCode::COMMAND_DISALLOWED; @@ -1199,7 +1199,7 @@ HCIStatusCode HCIHandler::le_start_scan(const bool filter_dup, WARN_PRINT("HCIHandler::le_start_scan: Not allowed: Advertising is enabled %s", toString().c_str()); return HCIStatusCode::COMMAND_DISALLOWED; } - if( hasScanType(currentScanType, ScanType::LE) ) { + if( is_set(currentScanType, ScanType::LE) ) { WARN_PRINT("HCIHandler::le_start_scan: Not allowed: LE Scan Enabled: %s", toString().c_str()); return HCIStatusCode::COMMAND_DISALLOWED; } @@ -1453,7 +1453,7 @@ HCIStatusCode HCIHandler::disconnect(const uint16_t conn_handle, const BDAddress HCIStatusCode HCIHandler::le_read_phy(const uint16_t conn_handle, const BDAddressAndType& peerAddressAndType, LE_PHYs& resTx, LE_PHYs& resRx) noexcept { - if( !isLEFeaturesBitSet(le_ll_feats, LE_Features::LE_2M_PHY) ) { + if( !is_set(le_ll_feats, LE_Features::LE_2M_PHY) ) { resTx = LE_PHYs::LE_1M; resRx = LE_PHYs::LE_1M; return HCIStatusCode::SUCCESS; @@ -1508,12 +1508,12 @@ HCIStatusCode HCIHandler::le_read_phy(const uint16_t conn_handle, const BDAddres } HCIStatusCode HCIHandler::le_set_default_phy(const LE_PHYs Tx, const LE_PHYs Rx) noexcept { - if( !isLEFeaturesBitSet(le_ll_feats, LE_Features::LE_2M_PHY) ) { - if( isLEPHYBitSet(Tx, LE_PHYs::LE_2M) ) { + if( !is_set(le_ll_feats, LE_Features::LE_2M_PHY) ) { + if( is_set(Tx, LE_PHYs::LE_2M) ) { WARN_PRINT("HCIHandler::le_set_default_phy: LE_2M_PHY no supported, requested Tx %s", to_string(Tx).c_str()); return HCIStatusCode::INVALID_PARAMS; } - if( isLEPHYBitSet(Rx, LE_PHYs::LE_2M) ) { + if( is_set(Rx, LE_PHYs::LE_2M) ) { WARN_PRINT("HCIHandler::le_set_default_phy: LE_2M_PHY no supported, requested Rx %s", to_string(Rx).c_str()); return HCIStatusCode::INVALID_PARAMS; } @@ -1544,12 +1544,12 @@ HCIStatusCode HCIHandler::le_set_default_phy(const LE_PHYs Tx, const LE_PHYs Rx) HCIStatusCode HCIHandler::le_set_phy(const uint16_t conn_handle, const BDAddressAndType& peerAddressAndType, const LE_PHYs Tx, const LE_PHYs Rx) noexcept { - if( !isLEFeaturesBitSet(le_ll_feats, LE_Features::LE_2M_PHY) ) { - if( isLEPHYBitSet(Tx, LE_PHYs::LE_2M) ) { + if( !is_set(le_ll_feats, LE_Features::LE_2M_PHY) ) { + if( is_set(Tx, LE_PHYs::LE_2M) ) { WARN_PRINT("HCIHandler::le_set_phy: LE_2M_PHY no supported, requested Tx %s", to_string(Tx).c_str()); return HCIStatusCode::INVALID_PARAMS; } - if( isLEPHYBitSet(Rx, LE_PHYs::LE_2M) ) { + if( is_set(Rx, LE_PHYs::LE_2M) ) { WARN_PRINT("HCIHandler::le_set_phy: LE_2M_PHY no supported, requested Rx %s", to_string(Rx).c_str()); return HCIStatusCode::INVALID_PARAMS; } |