microbit: Populate 'bonds' field in whitelist entry

Update to populate a recently introduced 'bonds' field in the whitelist_t
structure. This field records the number of IRKs present in the table, which
correlates to the number of bonds.
This commit is contained in:
Joe Finney 2016-02-07 20:03:24 +00:00
parent 06a34dad44
commit 2541e8fdb0
1 changed files with 3 additions and 0 deletions

View File

@ -74,9 +74,12 @@ public:
ble_error_t error = createWhitelistFromBondTable(whitelistFromBondTable);
if (error != BLE_ERROR_NONE) {
addresses.size = 0;
addresses.bonds = 0;
return error;
}
addresses.bonds = whitelistFromBondTable.irk_count;
/* Put all the addresses in the structure */
for (i = 0; i < whitelistFromBondTable.addr_count; ++i) {
if (i >= addresses.capacity) {