@@ -67,43 +67,6 @@ static bool is_in_range(T value, T lower_bound, T higher_bound)
67
67
return true ;
68
68
}
69
69
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
-
107
70
/*
108
71
* Return true of the connection parameters are acceptable as preferred connection
109
72
* parameters.
@@ -259,35 +222,6 @@ static bool is_random_address(const BLEProtocol::AddressBytes_t address)
259
222
is_random_static_address (address);
260
223
}
261
224
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
-
291
225
/*
292
226
* Return true if the whitelist in input is valid or false otherwise.
293
227
*/
@@ -347,18 +281,6 @@ static pal::whitelist_address_type_t to_whitelist_address_type(
347
281
pal::whitelist_address_type_t ::RANDOM_DEVICE_ADDRESS;
348
282
}
349
283
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
-
362
284
microsecond_t minSupervisionTimeout (
363
285
const conn_interval_t &maxConnectionInterval,
364
286
const slave_latency_t &slaveLatency
0 commit comments