Lightly modified version of the BLE stack, that doesn't bring up a DFUService by default... as we have our own.
Fork of BLE_API by
Revision 347:20be4234c6fe, committed 2015-05-08
- Comitter:
- rgrover1
- Date:
- Fri May 08 15:35:45 2015 +0100
- Parent:
- 346:4a42f777161f
- Child:
- 348:d5ad8959683f
- Commit message:
- Synchronized with git rev 714bda50
Author: Rohit Grover
add API for initializeSecurity()
Changed in this revision
common/BLEDeviceInstanceBase.h | Show annotated file Show diff for this revision Revisions of this file |
public/BLEDevice.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/common/BLEDeviceInstanceBase.h Thu Apr 30 08:37:22 2015 +0100 +++ b/common/BLEDeviceInstanceBase.h Fri May 08 15:35:45 2015 +0100 @@ -30,6 +30,7 @@ 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;
--- a/public/BLEDevice.h Thu Apr 30 08:37:22 2015 +0100 +++ b/public/BLEDevice.h Fri May 08 15:35:45 2015 +0100 @@ -445,6 +445,14 @@ */ 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 @@ transport->getPermittedTxPowerValues(valueArrayPP, countP); } +inline ble_error_t +BLEDevice::initializeSecurity(void) +{ + return transport->initializeSecurity(); +} + #endif // ifndef __BLE_DEVICE__ \ No newline at end of file