add APIs for getLinkSecurity() and purgeAllBondingState()

This commit is contained in:
Rohit Grover 2015-04-23 08:02:21 +01:00
parent 7559176d50
commit 985edbdf48
2 changed files with 33 additions and 1 deletions

View file

@ -356,6 +356,26 @@ public:
*/
void setOnSecurityContextStored(Gap::HandleSpecificEvent_t callback);
/**
* Get the security status of a connection.
*
* @param[in] connectionHandle Handle to identify the connection.
* @param[out] securityStatusP security status.
*
* @return BLE_SUCCESS Or appropriate error code indicating reason for failure.
*/
ble_error_t getLinkSecurity(Gap::Handle_t connectionHandle, Gap::LinkSecurityStatus_t *securityStatusP);
/**
* Delete all peer device context and all related bonding information from
* the database within the security manager.
*
* @retval BLE_ERROR_NONE On success, else an error code indicating reason for failure.
* @retval BLE_ERROR_INVALID_STATE If the API is called without module initialization and/or
* application registration.
*/
ble_error_t purgeAllBondingState(void);
/**
* Add a service declaration to the local server ATT table. Also add the
* characteristics contained within.
@ -759,6 +779,18 @@ BLEDevice::setOnSecurityContextStored(Gap::HandleSpecificEvent_t callback)
transport->getGap().setOnSecurityContextStored(callback);
}
inline ble_error_t
BLEDevice::getLinkSecurity(Gap::Handle_t connectionHandle, Gap::LinkSecurityStatus_t *securityStatusP)
{
return transport->getGap().getLinkSecurity(connectionHandle, securityStatusP);
}
inline ble_error_t
BLEDevice::purgeAllBondingState(void)
{
return transport->getGap().purgeAllBondingState();
}
inline ble_error_t
BLEDevice::addService(GattService &service)
{

View file

@ -112,7 +112,7 @@ private:
virtual ble_error_t setPreferredConnectionParams(const ConnectionParams_t *params) = 0;
virtual ble_error_t updateConnectionParams(Handle_t handle, const ConnectionParams_t *params) = 0;
virtual ble_error_t deleteAllBondedDevices(void) = 0;
virtual ble_error_t purgeAllBondingState(void) = 0;
virtual ble_error_t getLinkSecurity(Handle_t connectionHandle, LinkSecurityStatus_t *securityStatusP) = 0;
virtual ble_error_t setDeviceName(const uint8_t *deviceName) = 0;