Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nRF51822 by
Revision 597:bcd5e287c494, committed 2016-01-11
- Comitter:
- vcoubard
- Date:
- Mon Jan 11 10:19:35 2016 +0000
- Parent:
- 596:b66851544182
- Child:
- 598:814c1ce92947
- Commit message:
- Synchronized with git rev 0f76db4e
Author: Andres Amaya Garcia
Add helper function to get whitelist from SD bond table
Changed in this revision
source/btle/btle_security.cpp | Show annotated file Show diff for this revision Revisions of this file |
source/btle/btle_security.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/source/btle/btle_security.cpp Mon Jan 11 10:19:34 2016 +0000 +++ b/source/btle/btle_security.cpp Mon Jan 11 10:19:35 2016 +0000 @@ -43,6 +43,18 @@ }, /**< Key distribution bitmap: keys that the peripheral device will distribute. */ }; +ble_error_t btle_createWhitelistFromBonds(ble_gap_whitelist_t *p_whitelist) +{ + ret_code_t err = dm_whitelist_create(&applicationInstance, p_whitelist); + if (err == NRF_SUCCESS) { + return BLE_ERROR_NONE; + } else if (err == NRF_ERROR_NULL) { + return BLE_ERROR_PARAM_OUT_OF_RANGE; + } else { + return BLE_ERROR_INVALID_STATE; + } +} + ble_error_t btle_initializeSecurity(bool enableBonding, bool requireMITM,
--- a/source/btle/btle_security.h Mon Jan 11 10:19:34 2016 +0000 +++ b/source/btle/btle_security.h Mon Jan 11 10:19:35 2016 +0000 @@ -40,6 +40,8 @@ SecurityManager::SecurityIOCapabilities_t iocaps = SecurityManager::IO_CAPS_NONE, const SecurityManager::Passkey_t passkey = NULL); +ble_error_t btle_createWhitelistFromBonds(ble_gap_whitelist_t *p_whitelist); + /** * Get the security status of a link. *