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.
Dependencies: nrf51-sdk
Dependents: microbit-dal microbit-ble-open microbit-dal-eddystone microbit-dal-ble-accelerometer-example ... more
Diff: source/nRF5xGap.cpp
- Revision:
- 603:b1616eaf8206
- Parent:
- 601:5f4199aae50f
- Child:
- 604:0f5c8725146c
diff -r e7ba21c2c943 -r b1616eaf8206 source/nRF5xGap.cpp
--- a/source/nRF5xGap.cpp Mon Jan 11 10:19:37 2016 +0000
+++ b/source/nRF5xGap.cpp Mon Jan 11 10:19:37 2016 +0000
@@ -659,12 +659,16 @@
return BLE_ERROR_PARAM_OUT_OF_RANGE;
}
- whitelistAddressesSize = 0;
+ /* Test for invalid parameters before we change the internal state */
for (uint8_t i = 0; i < whitelistIn.size; ++i) {
if (whitelistIn.addresses[i].type == BLEProtocol::AddressType_t::RANDOM_PRIVATE_NON_RESOLVABLE) {
/* This is not allowed because it is completely meaningless */
return BLE_ERROR_INVALID_PARAM;
}
+ }
+
+ whitelistAddressesSize = 0;
+ for (uint8_t i = 0; i < whitelistIn.size; ++i) {
memcpy(&whitelistAddresses[whitelistAddressesSize], &whitelistIn.addresses[i], sizeof(BLEProtocol::Address_t));
whitelistAddressesSize++;
}