abc
Fork of BLE_API by
Diff: public/BLEDevice.h
- Revision:
- 357:d4bb5d2b837a
- Parent:
- 356:261c251c6936
- Child:
- 358:6a3536a141f3
--- a/public/BLEDevice.h Fri May 08 15:35:46 2015 +0100 +++ b/public/BLEDevice.h Fri May 08 15:35:47 2015 +0100 @@ -496,8 +496,20 @@ * 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). + * + * @param[in] enableBonding Allow for bonding. + * @param[in] requireMITM Require protection for man-in-the-middle attacks. + * @param[in] iocaps To specify IO capabilities of this peripheral, + * such as availability of a display or keyboard to + * support out-of-band exchanges of security data. + * @param[in] passkey To specify a static passkey. + * + * @return BLE_ERROR_NONE on success. */ - ble_error_t initializeSecurity(void); + ble_error_t initializeSecurity(bool enableBonding = true, + bool requireMITM = true, + Gap::SecurityIOCapabilities_t iocaps = Gap::IO_CAPS_NONE, + const Gap::Passkey_t passkey = NULL); public: BLEDevice() : transport(createBLEDeviceInstance()), advParams(), advPayload(), scanResponse(), needToSetAdvPayload(true) { @@ -891,9 +903,12 @@ } inline ble_error_t -BLEDevice::initializeSecurity(void) +BLEDevice::initializeSecurity(bool enableBonding, + bool requireMITM, + Gap::SecurityIOCapabilities_t iocaps, + const Gap::Passkey_t passkey) { - return transport->initializeSecurity(); + return transport->initializeSecurity(enableBonding, requireMITM, iocaps, passkey); } #endif // ifndef __BLE_DEVICE__ \ No newline at end of file