add API for initializeSecurity()

This commit is contained in:
Rohit Grover 2015-04-14 12:46:00 +01:00
parent bd493c8aae
commit 714bda5068
2 changed files with 15 additions and 0 deletions

View file

@ -30,6 +30,7 @@ public:
virtual ble_error_t init(void) = 0;
virtual ble_error_t shutdown(void) = 0;
virtual ble_error_t reset(void) = 0;
virtual ble_error_t initializeSecurity(void) = 0;
virtual ble_error_t setTxPower(int8_t txPower) = 0;
virtual void getPermittedTxPowerValues(const int8_t **, size_t *) = 0;
virtual void waitForEvent(void) = 0;

View file

@ -445,6 +445,14 @@ public:
*/
void getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP);
/**
* Enable the BLE stack's Security Manager. The Security Manager implements
* the actual cryptographic algorithms and protocol exchanges that allow two
* devices to securely exchange data and privately detect each other.
* Calling this API is a prerequisite for encryption and pairing (bonding).
*/
ble_error_t initializeSecurity(void);
public:
BLEDevice() : transport(createBLEDeviceInstance()), advParams(), advPayload(), scanResponse(), needToSetAdvPayload(true) {
advPayload.clear();
@ -800,4 +808,10 @@ BLEDevice::getPermittedTxPowerValues(const int8_t **valueArrayPP, size_t *countP
transport->getPermittedTxPowerValues(valueArrayPP, countP);
}
inline ble_error_t
BLEDevice::initializeSecurity(void)
{
return transport->initializeSecurity();
}
#endif // ifndef __BLE_DEVICE__