From 372e20367c8bed8bfc7c36b251127d4bb82ab585 Mon Sep 17 00:00:00 2001 From: Marcus Chang Date: Thu, 10 Dec 2015 15:02:05 +0000 Subject: [PATCH] Added SecurityManager::setLinkSecurity call for elevating security settings on a particular connection. --- ble/SecurityManager.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ble/SecurityManager.h b/ble/SecurityManager.h index 0e38061..444e3aa 100644 --- a/ble/SecurityManager.h +++ b/ble/SecurityManager.h @@ -120,7 +120,7 @@ public: * @param[in] connectionHandle Handle to identify the connection. * @param[out] securityStatusP Security status. * - * @return BLE_SUCCESS or appropriate error code indicating the failure reason. + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. */ virtual ble_error_t getLinkSecurity(Gap::Handle_t connectionHandle, LinkSecurityStatus_t *securityStatusP) { /* Avoid compiler warnings about unused variables. */ @@ -130,6 +130,23 @@ public: return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porters: override this API if security is supported. */ } + /** + * Set the security mode on a connection. Useful for elevating the security mode + * once certain conditions are met, e.g., a particular service is found. + * + * @param[in] connectionHandle Handle to identify the connection. + * @param[in] securityMode Requested security mode. + * + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ + virtual ble_error_t setLinkSecurity(Gap::Handle_t connectionHandle, SecurityMode_t securityMode) { + /* Avoid compiler warnings about unused variables. */ + (void)connectionHandle; + (void)securityMode; + + return BLE_ERROR_NOT_IMPLEMENTED; + } + /** * Delete all peer device context and all related bonding information from * the database within the security manager.