Skip to content

Commit a398e36

Browse files
committed
GenericGap: clean up unused helper functions
1 parent 4b4b2dc commit a398e36

File tree

2 files changed

+0
-83
lines changed

2 files changed

+0
-83
lines changed

features/FEATURE_BLE/ble/generic/GenericGap.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "ble/pal/GenericAccessService.h"
2929
#include "ble/pal/EventQueue.h"
3030
#include "ble/pal/ConnectionEventMonitor.h"
31-
#include "ble/pal/Deprecated.h"
3231

3332
#include "drivers/LowPowerTimeout.h"
3433
#include "drivers/LowPowerTicker.h"
@@ -60,14 +59,12 @@ class GenericGap :
6059
>
6160
{
6261
// Typedef of base and companion classes .
63-
// typedef ::ble::interface::LegacyGap<GenericGap> LegacyGap;
6462
typedef ::ble::interface::Gap<GenericGap> Gap;
6563
typedef pal::ConnectionEventMonitor<ConnectionEventMonitorEventHandler> ConnectionEventMonitor;
6664
typedef TPalGap<GenericGap> PalGap;
6765
typedef pal::GapEventHandler<GenericGap> PalGapEventHandler;
6866

6967
// Friendship with base classes
70-
// friend LegacyGap;
7168
friend Gap;
7269
friend ConnectionEventMonitor;
7370
friend pal::GapEventHandler<GenericGap>;
@@ -77,7 +74,6 @@ class GenericGap :
7774
using Gap::_eventHandler;
7875
using Gap::default_peripheral_privacy_configuration;
7976
using Gap::default_central_privacy_configuration;
80-
// using Gap::state;
8177

8278
typedef typename BLEProtocol::AddressBytes_t Address_t;
8379
typedef typename ble::whitelist_t whitelist_t;
@@ -707,7 +703,6 @@ class GenericGap :
707703
BitArray<MAX_ADVERTISING_SETS> _connectable_payload_size_exceeded;
708704
BitArray<MAX_ADVERTISING_SETS> _set_is_connectable;
709705

710-
// deprecation flags
711706
bool _user_manage_connection_parameter_requests : 1;
712707

713708
private:

features/FEATURE_BLE/source/generic/GenericGap.tpp

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -67,43 +67,6 @@ static bool is_in_range(T value, T lower_bound, T higher_bound)
6767
return true;
6868
}
6969

70-
/*
71-
* Return true if the connection parameters are valid or false otherwise.
72-
*/
73-
static bool is_connection_params_valid(const ::Gap::ConnectionParams_t *params)
74-
{
75-
if (params == NULL) {
76-
return false;
77-
}
78-
79-
if (is_in_range(params->slaveLatency, slave_latency_min, slave_latency_max) == false) {
80-
return false;
81-
}
82-
83-
if (is_in_range(params->maxConnectionInterval, connection_interval_min, connection_interval_max) == false) {
84-
return false;
85-
}
86-
87-
if (is_in_range(params->minConnectionInterval, connection_interval_min, params->maxConnectionInterval) == false) {
88-
return false;
89-
}
90-
91-
if (is_in_range(params->connectionSupervisionTimeout, supervision_timeout_min, supervision_timeout_max) == false) {
92-
return false;
93-
}
94-
95-
uint16_t max_connection_interval_ms =
96-
((uint32_t) params->maxConnectionInterval * 125) / 100;
97-
uint16_t min_connection_supervision_timeout =
98-
((1 + params->slaveLatency) * max_connection_interval_ms * 2) / 10;
99-
100-
if (params->connectionSupervisionTimeout < min_connection_supervision_timeout) {
101-
return false;
102-
}
103-
104-
return true;
105-
}
106-
10770
/*
10871
* Return true of the connection parameters are acceptable as preferred connection
10972
* parameters.
@@ -259,35 +222,6 @@ static bool is_random_address(const BLEProtocol::AddressBytes_t address)
259222
is_random_static_address(address);
260223
}
261224

262-
/*
263-
* Check disconnection reason validity.
264-
*/
265-
static bool is_disconnection_reason_valid(disconnection_reason_t reason)
266-
{
267-
switch (reason.value()) {
268-
/**
269-
* Note: accepted reasons are:
270-
typedef pal::disconnection_reason_t reason_t;
271-
case reason_t::AUTHENTICATION_FAILLURE:
272-
case reason_t::REMOTE_USER_TERMINATED_CONNECTION:
273-
case reason_t::REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES:
274-
case reason_t::REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_POWER_OFF:
275-
case reason_t::UNSUPPORTED_REMOTE_FEATURE:
276-
case reason_t::PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED:
277-
case reason_t::UNACCEPTABLE_CONNECTION_PARAMETERS:
278-
*/
279-
280-
// TODO Fix Disconnectionreason_t which expose invalid value
281-
case disconnection_reason_t::REMOTE_USER_TERMINATED_CONNECTION:
282-
case disconnection_reason_t::REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES:
283-
case disconnection_reason_t::REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF:
284-
case disconnection_reason_t::UNACCEPTABLE_CONNECTION_PARAMETERS:
285-
return true;
286-
default:
287-
return false;
288-
}
289-
}
290-
291225
/*
292226
* Return true if the whitelist in input is valid or false otherwise.
293227
*/
@@ -347,18 +281,6 @@ static pal::whitelist_address_type_t to_whitelist_address_type(
347281
pal::whitelist_address_type_t::RANDOM_DEVICE_ADDRESS;
348282
}
349283

350-
/*
351-
* Convert a BLEProtocol::AddressType_t into a pal::peer_address_type
352-
*/
353-
static peer_address_type_t to_peer_address_type(
354-
LegacyAddressType_t address_type
355-
)
356-
{
357-
return (address_type == LegacyAddressType::PUBLIC) ?
358-
peer_address_type_t::PUBLIC :
359-
peer_address_type_t::RANDOM;
360-
}
361-
362284
microsecond_t minSupervisionTimeout(
363285
const conn_interval_t &maxConnectionInterval,
364286
const slave_latency_t &slaveLatency

0 commit comments

Comments
 (0)