BLE: use up-to-date structs for disconnections

pull/12730/head
Lingkai Dong 2020-03-31 13:06:33 +01:00
parent c17cf0f3f3
commit 55ecc57ac9
7 changed files with 13 additions and 11 deletions

View File

@ -431,7 +431,7 @@ private:
*/
void on_connected_(
connection_handle_t connection,
::Gap::Role_t role,
connection_role_t role,
peer_address_type_t peer_address_type,
const BLEProtocol::AddressBytes_t peer_address,
BLEProtocol::AddressType_t local_address_type,
@ -448,7 +448,7 @@ private:
*/
void on_disconnected_(
connection_handle_t connection,
::Gap::DisconnectionReason_t reason
disconnection_reason_t reason
);
/**

View File

@ -51,7 +51,7 @@ public:
*/
void on_connected(
connection_handle_t connection,
::Gap::Role_t role,
connection_role_t role,
ble::peer_address_type_t peer_address_type,
const BLEProtocol::AddressBytes_t peer_address,
BLEProtocol::AddressType_t local_address_type,
@ -77,7 +77,7 @@ public:
*/
void on_disconnected(
connection_handle_t connection,
::Gap::DisconnectionReason_t reason
ble::disconnection_reason_t reason
) {
self()->on_disconnected_(connection, reason);
}

View File

@ -228,7 +228,9 @@ struct hci_error_code_t : SafeEnum<hci_error_code_t, uint8_t> {
};
typedef ble::local_disconnection_reason_t disconnection_reason_t;
typedef ble::local_disconnection_reason_t local_disconnection_reason_t;
typedef ble::disconnection_reason_t disconnection_reason_t;
typedef ble::advertising_filter_policy_t advertising_filter_policy_t;

View File

@ -1881,7 +1881,7 @@ public:
*/
ble_error_t disconnect(
connection_handle_t connection,
disconnection_reason_t disconnection_reason
local_disconnection_reason_t disconnection_reason
) {
return impl()->disconnect_(connection, disconnection_reason);
}

View File

@ -1104,7 +1104,7 @@ void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::set_mitm_perfo
template<template<class> class TPalSecurityManager, template<class> class SigningMonitor>
void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::on_connected_(
connection_handle_t connection,
::Gap::Role_t role,
connection_role_t role,
peer_address_type_t peer_address_type,
const BLEProtocol::AddressBytes_t peer_address,
BLEProtocol::AddressType_t local_address_type,
@ -1120,7 +1120,7 @@ void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::on_connected_(
// setup the control block
cb->local_address = local_address;
cb->is_master = (role == ::Gap::CENTRAL);
cb->is_master = (role == connection_role_t::CENTRAL);
// get the associated db handle and the distribution flags if any
cb->db_entry = _db->open_entry(peer_address_type, peer_address);
@ -1150,7 +1150,7 @@ void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::on_connected_(
template<template<class> class TPalSecurityManager, template<class> class SigningMonitor>
void GenericSecurityManager<TPalSecurityManager, SigningMonitor>::on_disconnected_(
connection_handle_t connection,
::Gap::DisconnectionReason_t reason
disconnection_reason_t reason
) {
#if BLE_FEATURE_SECURITY
MBED_ASSERT(_db);

View File

@ -126,7 +126,7 @@ public:
ble_error_t disconnect_(
connection_handle_t connection,
disconnection_reason_t disconnection_reason
local_disconnection_reason_t disconnection_reason
);
bool is_privacy_supported_();

View File

@ -394,7 +394,7 @@ ble_error_t Gap<EventHandler>::reject_connection_parameter_request_(
template<class EventHandler>
ble_error_t Gap<EventHandler>::disconnect_(
connection_handle_t connection,
disconnection_reason_t disconnection_reason
local_disconnection_reason_t disconnection_reason
)
{
DmConnClose(