File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
features/FEATURE_BLE/ble/generic Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -584,28 +584,32 @@ class SecurityDb {
584
584
WhitelistDbCb_t cb,
585
585
::Gap::Whitelist_t *whitelist
586
586
) {
587
- for (size_t i = 0 ; i < get_entry_count () && i < whitelist->capacity ; i++) {
587
+ for (size_t i = 0 ; i < get_entry_count () && whitelist-> size < whitelist->capacity ; i++) {
588
588
entry_handle_t db_handle = get_entry_handle_by_index (i);
589
589
SecurityDistributionFlags_t* flags = get_distribution_flags (db_handle);
590
590
591
591
if (!flags) {
592
592
continue ;
593
593
}
594
594
595
+ SecurityEntryIdentity_t* identity = read_in_entry_peer_identity (db_handle);
596
+ if (!identity) {
597
+ continue ;
598
+ }
599
+
600
+ memcpy (
601
+ whitelist->addresses [whitelist->size ].address ,
602
+ identity->identity_address .data (),
603
+ sizeof (BLEProtocol::AddressBytes_t)
604
+ );
605
+
595
606
if (flags->peer_address_is_public ) {
596
- whitelist->addresses [i ].type = BLEProtocol::AddressType::PUBLIC;
607
+ whitelist->addresses [whitelist-> size ].type = BLEProtocol::AddressType::PUBLIC;
597
608
} else {
598
- whitelist->addresses [i ].type = BLEProtocol::AddressType::RANDOM_STATIC;
609
+ whitelist->addresses [whitelist-> size ].type = BLEProtocol::AddressType::RANDOM_STATIC;
599
610
}
600
611
601
- SecurityEntryIdentity_t* identity = read_in_entry_peer_identity (db_handle);
602
- if (identity) {
603
- memcpy (
604
- whitelist->addresses [i].address ,
605
- identity->identity_address .data (),
606
- sizeof (BLEProtocol::AddressBytes_t)
607
- );
608
- }
612
+ whitelist->size ++;
609
613
}
610
614
611
615
cb (whitelist);
You can’t perform that action at this time.
0 commit comments