BLE: Move GapScanParameters header into ble/gap/ScanParameters

pull/8738/head
Vincent Coubard 2018-11-14 13:31:48 +00:00
parent cf69013bb6
commit 2d1362c2c4
4 changed files with 23 additions and 17 deletions

View File

@ -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. */

View File

@ -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

View File

@ -132,7 +132,7 @@ public:
virtual bool isPeriodicAdvertisingActive(AdvHandle_t handle);
virtual ble_error_t setScanParameters(const GapScanParameters &params);
virtual ble_error_t setScanParameters(const ScanParameters &params);
virtual ble_error_t startScan(
scanning_filter_duplicates_t filtering,

View File

@ -2351,7 +2351,7 @@ void GenericGap::on_scan_request_received(
);
}
ble_error_t GenericGap::setScanParameters(const GapScanParameters &params)
ble_error_t GenericGap::setScanParameters(const ScanParameters &params)
{
use_non_deprecated_scan_api();
@ -2384,7 +2384,7 @@ ble_error_t GenericGap::setScanParameters(const GapScanParameters &params)
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(