From 9e98a7219854f6f7e571001e3f4c8973901d852a Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Wed, 21 Feb 2018 15:00:17 +0000 Subject: [PATCH] BLE: Move cordio default scan and connection params in global memory. --- .../FEATURE_BLE/source/generic/GenericGap.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/features/FEATURE_BLE/source/generic/GenericGap.cpp b/features/FEATURE_BLE/source/generic/GenericGap.cpp index ad1bc5b039..55e1e5ef80 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.cpp +++ b/features/FEATURE_BLE/source/generic/GenericGap.cpp @@ -44,6 +44,15 @@ static const uint16_t advertising_interval_max = 0x4000; static const uint16_t supervision_timeout_min = 0x000A; static const uint16_t supervision_timeout_max = 0x0C80; +static const ConnectionParams_t default_connection_params = { + /* min conn interval */ 50, + /* max conn interval */ 100, + /* slave latency */ 0, + /* supervision timeout */ 600 +}; + +static const GapScanningParams default_scan_params; + /* * Return true if value is included in the range [lower_bound : higher_bound] */ @@ -492,14 +501,6 @@ ble_error_t GenericGap::connect( const ConnectionParams_t* connectionParams, const GapScanningParams* scanParams ) { - ConnectionParams_t default_connection_params = { - /* min conn interval */ 50, - /* max conn interval */ 100, - /* slave latency */ 0, - /* supervision timeout */ 600 - }; - GapScanningParams default_scan_params; - if (connectionParams == NULL) { connectionParams = &default_connection_params; }