mirror of https://github.com/ARMmbed/mbed-os.git
BLE: merge ble::scanning_filter_duplicates_t and pal::duplicate_filter_t
parent
cc8b43f3ab
commit
d1cb1e1a39
|
@ -1944,7 +1944,7 @@ public:
|
|||
* @return BLE_ERROR_NONE on success.
|
||||
*/
|
||||
virtual ble_error_t startScan(
|
||||
ble::scanning_filter_duplicates_t filtering = ble::SCAN_FILTER_DUPLICATES_DISABLED,
|
||||
ble::duplicates_filter_t filtering = ble::duplicates_filter_t::DISABLE,
|
||||
ble::scan_duration_t duration = ble::scan_duration_t(0),
|
||||
ble::scan_period_t period = ble::scan_period_t(0)
|
||||
) {
|
||||
|
|
|
@ -347,17 +347,33 @@ struct initiator_filter_policy_t : SafeEnum<initiator_filter_policy_t, uint8_t>
|
|||
initiator_filter_policy_t(type value) : SafeEnum(value) { }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Scanning policy filter mode.
|
||||
*
|
||||
* @see Bluetooth Core Specification 4.2 (Vol. 6), Part B, Section 4.3.3.
|
||||
*/
|
||||
enum scanning_filter_duplicates_t {
|
||||
SCAN_FILTER_DUPLICATES_DISABLED = 0, /**< Do not remove duplicate reports. */
|
||||
SCAN_FILTER_DUPLICATES_ENABLED = 1, /**< Remove duplicate reports. */
|
||||
SCAN_FILTER_DUPLICATES_ENABLED_PER_PERIOD = 2 /**< Remove reports which are duplicate
|
||||
within a single period. */
|
||||
struct duplicates_filter_t : SafeEnum<duplicates_filter_t, uint8_t >{
|
||||
enum type {
|
||||
/**
|
||||
* Disable duplicate filtering.
|
||||
*/
|
||||
DISABLE,
|
||||
|
||||
/**
|
||||
* Enable duplicate filtering.
|
||||
*/
|
||||
ENABLE,
|
||||
|
||||
/**
|
||||
* Enable duplicate filtering, reset the cache periodically.
|
||||
*/
|
||||
PERIODIC_RESET
|
||||
};
|
||||
|
||||
/**
|
||||
* Construct a new duplicates_filter_t value.
|
||||
*/
|
||||
duplicates_filter_t(type value) : SafeEnum(value) { }
|
||||
};
|
||||
|
||||
struct own_address_type_t : ble::SafeEnum<own_address_type_t, uint8_t> {
|
||||
|
|
|
@ -175,7 +175,7 @@ public:
|
|||
/** @copydoc Gap::startScan
|
||||
*/
|
||||
virtual ble_error_t startScan(
|
||||
scanning_filter_duplicates_t filtering,
|
||||
duplicates_filter_t filtering,
|
||||
scan_duration_t duration,
|
||||
scan_period_t period
|
||||
);
|
||||
|
|
|
@ -644,30 +644,7 @@ struct advertising_fragment_description_t :
|
|||
SafeEnum<advertising_fragment_description_t, uint8_t>(value) { }
|
||||
};
|
||||
|
||||
struct duplicates_filter_t : SafeEnum<duplicates_filter_t, uint8_t >{
|
||||
enum type {
|
||||
/**
|
||||
* Disable duplicate filtering.
|
||||
*/
|
||||
DISABLE,
|
||||
|
||||
/**
|
||||
* Enable duplicate filtering.
|
||||
*/
|
||||
ENABLE,
|
||||
|
||||
/**
|
||||
* Enable duplicate filtering, reset the cache periodically.
|
||||
*/
|
||||
PERIODIC_RESET
|
||||
};
|
||||
|
||||
/**
|
||||
* Construct a new duplicates_filter_t value.
|
||||
*/
|
||||
duplicates_filter_t(type value) :
|
||||
SafeEnum<duplicates_filter_t, uint8_t>(value) { }
|
||||
};
|
||||
typedef ble::duplicates_filter_t duplicates_filter_t;
|
||||
|
||||
/**
|
||||
* Identify a periodic advertising sync.
|
||||
|
|
|
@ -2412,7 +2412,7 @@ ble_error_t GenericGap::setScanParameters(const ScanParameters ¶ms)
|
|||
}
|
||||
|
||||
ble_error_t GenericGap::startScan(
|
||||
scanning_filter_duplicates_t filtering,
|
||||
duplicates_filter_t filtering,
|
||||
scan_duration_t duration,
|
||||
scan_period_t period
|
||||
)
|
||||
|
@ -2427,7 +2427,7 @@ ble_error_t GenericGap::startScan(
|
|||
if (is_extended_advertising_available()) {
|
||||
return _pal_gap.extended_scan_enable(
|
||||
/* enable */true,
|
||||
(pal::duplicates_filter_t::type) filtering,
|
||||
filtering,
|
||||
duration.value(),
|
||||
period.value()
|
||||
);
|
||||
|
@ -2438,7 +2438,7 @@ ble_error_t GenericGap::startScan(
|
|||
|
||||
ble_error_t err = _pal_gap.scan_enable(
|
||||
true,
|
||||
filtering == SCAN_FILTER_DUPLICATES_DISABLED ? false : true
|
||||
filtering == duplicates_filter_t::DISABLE ? false : true
|
||||
);
|
||||
|
||||
if (err) {
|
||||
|
|
Loading…
Reference in New Issue