From f53359f60c3069001ca03309bb21b94fc4f43809 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Wed, 31 Jan 2018 16:42:35 -0600 Subject: [PATCH] doxygen --- .../FEATURE_BLE/ble/generic/GenericSecurityDb.h | 4 ++-- .../ble/generic/GenericSecurityManager.h | 17 +++++++++++++++++ .../source/generic/GenericSecurityManager.cpp | 3 +-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/features/FEATURE_BLE/ble/generic/GenericSecurityDb.h b/features/FEATURE_BLE/ble/generic/GenericSecurityDb.h index 2af069179f..60dbb85db5 100644 --- a/features/FEATURE_BLE/ble/generic/GenericSecurityDb.h +++ b/features/FEATURE_BLE/ble/generic/GenericSecurityDb.h @@ -334,10 +334,10 @@ public: /** * If implementation has enough memory it can return the - * irk list synchronously, otherwise asynchronously iteration + * irk list synchronously, otherwise asynchronous iteration * shall be used through get_next_entry_peer_identity * - * @param[in] list the list of entires, NULL if empty + * @param[in] list the list of entries, NULL if empty * * @return BLE_ERROR_NONE if the function is implemented. */ diff --git a/features/FEATURE_BLE/ble/generic/GenericSecurityManager.h b/features/FEATURE_BLE/ble/generic/GenericSecurityManager.h index 5696a59fc2..6614527f71 100644 --- a/features/FEATURE_BLE/ble/generic/GenericSecurityManager.h +++ b/features/FEATURE_BLE/ble/generic/GenericSecurityManager.h @@ -428,8 +428,25 @@ public: const rand_t *rand ); + /** + * Inform the security manager that a device has been disconnected and its + * entry can be put in NVM storage. Called by GAP. + * + * @param[in] connectionHandle Handle to identify the connection. + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ virtual void on_disconnected(connection_handle_t connection); + /** + * Inform the Security manager of a new connection. This will create + * or retrieve an existing security manager entry for the connected device. + * Called by GAP. + * + * @param[in] connectionHandle Handle to identify the connection. + * @param peer_address Address of the connected device. + * @param is_master True if device is the master. + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ virtual void on_connected(connection_handle_t connection, address_t peer_address, bool is_master); private: diff --git a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp index c4f1b382de..0ef994b542 100644 --- a/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp +++ b/features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp @@ -554,13 +554,12 @@ bool GenericSecurityManager::check_against_identity_address( /* prand_hash now contains the hash result in the first 3 octects * compare it with the hash in the peer identity address */ - - /* can't use memcmp because of address_t constness */ if ((prand_hash[0] == peer_address[3]) || (prand_hash[1] == peer_address[4]) || (prand_hash[2] == peer_address[5])) { return true; } + return false; }