mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Move GapScanParameters header into ble/gap/ScanParameters
parent
cf69013bb6
commit
2d1362c2c4
|
@ -19,17 +19,23 @@
|
|||
|
||||
#include "BLETypes.h"
|
||||
#include "BLEProtocol.h"
|
||||
#include "GapAdvertisingData.h"
|
||||
|
||||
// gap headers
|
||||
#include "ble/gap/AdvertisingDataBuilder.h"
|
||||
#include "ble/gap/ExtendedConnectParameters.h"
|
||||
#include "GapAdvertisingParams.h"
|
||||
#include "GapScanningParams.h"
|
||||
#include "GapEvents.h"
|
||||
#include "ble/GapScanParameters.h"
|
||||
#include "ble/gap/ScanParameters.h"
|
||||
#include "ble/gap/AdvertisingParameters.h"
|
||||
|
||||
// leagacy gap headers
|
||||
#include "ble/GapAdvertisingData.h"
|
||||
#include "ble/GapAdvertisingParams.h"
|
||||
#include "ble/GapScanningParams.h"
|
||||
#include "ble/GapEvents.h"
|
||||
|
||||
#include "CallChainOfFunctionPointersWithContext.h"
|
||||
#include "FunctionPointerWithContext.h"
|
||||
#include "platform/mbed_toolchain.h"
|
||||
#include "gap/AdvertisingParameters.h"
|
||||
|
||||
|
||||
/**
|
||||
* @addtogroup ble
|
||||
|
@ -2433,7 +2439,7 @@ public:
|
|||
* @return BLE_ERROR_NONE on success.
|
||||
*/
|
||||
virtual ble_error_t setScanParameters(
|
||||
const GapScanParameters& params
|
||||
const ScanParameters& params
|
||||
) {
|
||||
use_non_deprecated_scan_api();
|
||||
/* Requesting action from porter(s): override this API if this capability is supported. */
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
|
||||
class GapScanParameters {
|
||||
class ScanParameters {
|
||||
public:
|
||||
typedef ble::unit_scan_window_t scan_window_t;
|
||||
typedef ble::unit_scan_interval_t scan_interval_t;
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
bool active_scanning;
|
||||
};
|
||||
|
||||
GapScanParameters() :
|
||||
ScanParameters() :
|
||||
own_address_type(PUBLIC_ADDRESS),
|
||||
scanning_filter_policy(ble::SCAN_POLICY_IGNORE_WHITELIST),
|
||||
phys(ble::phy_set_t::PHY_SET_1M),
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
)
|
||||
{ }
|
||||
|
||||
GapScanParameters& set_own_address_type(own_address_type_t address)
|
||||
ScanParameters& set_own_address_type(own_address_type_t address)
|
||||
{
|
||||
own_address_type = address;
|
||||
return *this;
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
return own_address_type;
|
||||
}
|
||||
|
||||
GapScanParameters& set_scanning_filter_policy(ble::scanning_policy_mode_t filter_policy)
|
||||
ScanParameters& set_scanning_filter_policy(ble::scanning_policy_mode_t filter_policy)
|
||||
{
|
||||
scanning_filter_policy = filter_policy;
|
||||
return *this;
|
||||
|
@ -94,7 +94,7 @@ public:
|
|||
return scanning_filter_policy;
|
||||
}
|
||||
|
||||
GapScanParameters& set_scanning_phys(bool enable_1m, bool enable_coded)
|
||||
ScanParameters& set_scanning_phys(bool enable_1m, bool enable_coded)
|
||||
{
|
||||
phys.set_1m(enable_1m);
|
||||
phys.set_coded(enable_coded);
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
return phys;
|
||||
}
|
||||
|
||||
GapScanParameters& set_1m_phy_configuration(
|
||||
ScanParameters& set_1m_phy_configuration(
|
||||
scan_interval_t interval,
|
||||
scan_window_t window,
|
||||
bool active_scanning
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
return phy_1m_configuration;
|
||||
}
|
||||
|
||||
GapScanParameters& set_coded_phy_configuration(
|
||||
ScanParameters& set_coded_phy_configuration(
|
||||
scan_interval_t interval,
|
||||
scan_window_t window,
|
||||
bool active_scanning
|
|
@ -132,7 +132,7 @@ public:
|
|||
|
||||
virtual bool isPeriodicAdvertisingActive(AdvHandle_t handle);
|
||||
|
||||
virtual ble_error_t setScanParameters(const GapScanParameters ¶ms);
|
||||
virtual ble_error_t setScanParameters(const ScanParameters ¶ms);
|
||||
|
||||
virtual ble_error_t startScan(
|
||||
scanning_filter_duplicates_t filtering,
|
||||
|
|
|
@ -2351,7 +2351,7 @@ void GenericGap::on_scan_request_received(
|
|||
);
|
||||
}
|
||||
|
||||
ble_error_t GenericGap::setScanParameters(const GapScanParameters ¶ms)
|
||||
ble_error_t GenericGap::setScanParameters(const ScanParameters ¶ms)
|
||||
{
|
||||
use_non_deprecated_scan_api();
|
||||
|
||||
|
@ -2384,7 +2384,7 @@ ble_error_t GenericGap::setScanParameters(const GapScanParameters ¶ms)
|
|||
return BLE_ERROR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
GapScanParameters::phy_configuration_t legacy_configuration =
|
||||
ScanParameters::phy_configuration_t legacy_configuration =
|
||||
params.get_1m_configuration();
|
||||
|
||||
return _pal_gap.set_scan_parameters(
|
||||
|
|
Loading…
Reference in New Issue