mirror of https://github.com/ARMmbed/mbed-os.git
BLE - Return supported feature based on compile time features.
parent
04891b205c
commit
24f7f36f01
|
@ -22,6 +22,32 @@ namespace interface {
|
|||
template<class Impl>
|
||||
bool Gap<Impl>::isFeatureSupported(controller_supported_features_t feature)
|
||||
{
|
||||
#if !BLE_FEATURE_PHY_MANAGEMENT
|
||||
if (feature == ble::controller_supported_features_t::LE_CODED_PHY ||
|
||||
feature == ble::controller_supported_features_t::LE_2M_PHY
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !BLE_FEATURE_EXTENDED_ADVERTISING
|
||||
if (feature == ble::controller_supported_features_t::LE_EXTENDED_ADVERTISING) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !BLE_FEATURE_PERIODIC_ADVERTISING
|
||||
if (feature == ble::controller_supported_features_t::LE_PERIODIC_ADVERTISING) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !BLE_FEATURE_PRIVACY
|
||||
if (feature == ble::controller_supported_features_t::LL_PRIVACY) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return impl()->isFeatureSupported_(feature);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,32 @@ bool Gap<EventHandler>::is_feature_supported_(
|
|||
ble::controller_supported_features_t feature
|
||||
)
|
||||
{
|
||||
#if !BLE_FEATURE_PHY_MANAGEMENT
|
||||
if (feature == ble::controller_supported_features_t::LE_CODED_PHY ||
|
||||
feature == ble::controller_supported_features_t::LE_2M_PHY
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !BLE_FEATURE_EXTENDED_ADVERTISING
|
||||
if (feature == ble::controller_supported_features_t::LE_EXTENDED_ADVERTISING) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !BLE_FEATURE_PERIODIC_ADVERTISING
|
||||
if (feature == ble::controller_supported_features_t::LE_PERIODIC_ADVERTISING) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !BLE_FEATURE_PRIVACY
|
||||
if (feature == ble::controller_supported_features_t::LL_PRIVACY) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return (HciGetLeSupFeat() & (1 << feature.value()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue