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
Diff: source/btle/btle_security.cpp
- Revision:
- 599:3e66e1eb264d
- Parent:
- 598:814c1ce92947
- Child:
- 613:cbc548e9df98
diff -r 814c1ce92947 -r 3e66e1eb264d source/btle/btle_security.cpp
--- a/source/btle/btle_security.cpp Mon Jan 11 10:19:35 2016 +0000
+++ b/source/btle/btle_security.cpp Mon Jan 11 10:19:36 2016 +0000
@@ -45,19 +45,8 @@
}, /**< Key distribution bitmap: keys that the peripheral device will distribute. */
};
-ble_error_t btle_createWhitelistFromBondTable(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;
- }
-}
-
-bool btle_hasInitializedSecurity(void)
+bool
+btle_hasInitializedSecurity(void)
{
return initialized;
}
@@ -281,7 +270,26 @@
return NRF_SUCCESS;
}
-bool btle_matchAddressAndIrk(ble_gap_addr_t const * p_addr, ble_gap_irk_t const * p_irk)
+ble_error_t
+btle_createWhitelistFromBondTable(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;
+ }
+}
+
+
+bool
+btle_matchAddressAndIrk(ble_gap_addr_t const * p_addr, ble_gap_irk_t const * p_irk)
+{
+ /*
+ * Use a helper function from the Nordic SDK to test whether the BLE
+ * address can be generated using the IRK.
+ */
return im_address_resolve(p_addr, p_irk);
}
\ No newline at end of file
