pull/6188/head
paul-szczepanek-arm 2018-01-31 16:42:35 -06:00
parent 132b9e01bf
commit f53359f60c
3 changed files with 20 additions and 4 deletions

View File

@ -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.
*/

View File

@ -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:

View File

@ -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;
}