Skip to content

Commit 397373f

Browse files
committed
BLE: use up-to-date structs for disconnections
1 parent 240fc8f commit 397373f

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

features/FEATURE_BLE/ble/generic/GenericSecurityManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ class GenericSecurityManager :
431431
*/
432432
void on_connected_(
433433
connection_handle_t connection,
434-
::Gap::Role_t role,
434+
connection_role_t role,
435435
peer_address_type_t peer_address_type,
436436
const BLEProtocol::AddressBytes_t peer_address,
437437
BLEProtocol::AddressType_t local_address_type,
@@ -448,7 +448,7 @@ class GenericSecurityManager :
448448
*/
449449
void on_disconnected_(
450450
connection_handle_t connection,
451-
::Gap::DisconnectionReason_t reason
451+
disconnection_reason_t reason
452452
);
453453

454454
/**

features/FEATURE_BLE/ble/pal/ConnectionEventMonitor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ConnectionEventMonitorEventHandler {
5151
*/
5252
void on_connected(
5353
connection_handle_t connection,
54-
::Gap::Role_t role,
54+
connection_role_t role,
5555
ble::peer_address_type_t peer_address_type,
5656
const BLEProtocol::AddressBytes_t peer_address,
5757
BLEProtocol::AddressType_t local_address_type,
@@ -77,7 +77,7 @@ class ConnectionEventMonitorEventHandler {
7777
*/
7878
void on_disconnected(
7979
connection_handle_t connection,
80-
::Gap::DisconnectionReason_t reason
80+
ble::disconnection_reason_t reason
8181
) {
8282
self()->on_disconnected_(connection, reason);
8383
}

features/FEATURE_BLE/ble/pal/GapTypes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ struct hci_error_code_t : SafeEnum<hci_error_code_t, uint8_t> {
228228
};
229229

230230

231-
typedef ble::local_disconnection_reason_t disconnection_reason_t;
231+
typedef ble::local_disconnection_reason_t local_disconnection_reason_t;
232+
233+
typedef ble::disconnection_reason_t disconnection_reason_t;
232234

233235
typedef ble::advertising_filter_policy_t advertising_filter_policy_t;
234236

features/FEATURE_BLE/ble/pal/PalGap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,7 @@ struct Gap {
18811881
*/
18821882
ble_error_t disconnect(
18831883
connection_handle_t connection,
1884-
disconnection_reason_t disconnection_reason
1884+
local_disconnection_reason_t disconnection_reason
18851885
) {
18861886
return impl()->disconnect_(connection, disconnection_reason);
18871887
}

features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::set_mitm_perfo
11041104
template<template<class> class TPalSecurityManager, template<class> class SigningMonitor>
11051105
void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::on_connected_(
11061106
connection_handle_t connection,
1107-
::Gap::Role_t role,
1107+
connection_role_t role,
11081108
peer_address_type_t peer_address_type,
11091109
const BLEProtocol::AddressBytes_t peer_address,
11101110
BLEProtocol::AddressType_t local_address_type,
@@ -1120,7 +1120,7 @@ void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::on_connected_(
11201120

11211121
// setup the control block
11221122
cb->local_address = local_address;
1123-
cb->is_master = (role == ::Gap::CENTRAL);
1123+
cb->is_master = (role == connection_role_t::CENTRAL);
11241124

11251125
// get the associated db handle and the distribution flags if any
11261126
cb->db_entry = _db->open_entry(peer_address_type, peer_address);
@@ -1150,7 +1150,7 @@ void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::on_connected_(
11501150
template<template<class> class TPalSecurityManager, template<class> class SigningMonitor>
11511151
void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::on_disconnected_(
11521152
connection_handle_t connection,
1153-
::Gap::DisconnectionReason_t reason
1153+
disconnection_reason_t reason
11541154
) {
11551155
#if BLE_FEATURE_SECURITY
11561156
MBED_ASSERT(_db);

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class Gap : public ::ble::pal::Gap<Gap<EH>, EH> {
126126

127127
ble_error_t disconnect_(
128128
connection_handle_t connection,
129-
disconnection_reason_t disconnection_reason
129+
local_disconnection_reason_t disconnection_reason
130130
);
131131

132132
bool is_privacy_supported_();

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ ble_error_t Gap<EventHandler>::reject_connection_parameter_request_(
394394
template<class EventHandler>
395395
ble_error_t Gap<EventHandler>::disconnect_(
396396
connection_handle_t connection,
397-
disconnection_reason_t disconnection_reason
397+
local_disconnection_reason_t disconnection_reason
398398
)
399399
{
400400
DmConnClose(

0 commit comments

Comments
 (0)