mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-06 21:40:04 +00:00
le_device_db_tlv: don't increase num valid entries if entry is replaced
This commit is contained in:
parent
2fca4dad95
commit
99f3ea79a3
@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
- SM: Work around for unexpected Windows 10 disconnect for BR Secure Connections (SMP over BR timeout)
|
- SM: Work around for unexpected Windows 10 disconnect for BR Secure Connections (SMP over BR timeout)
|
||||||
- SM: support storing bonding information for devices with identical IRK but different public addresses
|
- SM: support storing bonding information for devices with identical IRK but different public addresses
|
||||||
- GAP: restart advertising when private address changes
|
- GAP: restart advertising when private address changes
|
||||||
|
- le_device_db_tlv: keep number of devices reported by le_device_db_count if old entry is replaced
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Drop iOS support
|
- Drop iOS support
|
||||||
|
@ -203,6 +203,7 @@ int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk){
|
|||||||
int index_for_lowest_seq_nr = -1;
|
int index_for_lowest_seq_nr = -1;
|
||||||
int index_for_addr = -1;
|
int index_for_addr = -1;
|
||||||
int index_for_empty = -1;
|
int index_for_empty = -1;
|
||||||
|
bool new_entry = false;
|
||||||
|
|
||||||
// find unused entry in the used list
|
// find unused entry in the used list
|
||||||
int i;
|
int i;
|
||||||
@ -234,6 +235,7 @@ int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk){
|
|||||||
if (index_for_addr >= 0){
|
if (index_for_addr >= 0){
|
||||||
index_to_use = index_for_addr;
|
index_to_use = index_for_addr;
|
||||||
} else if (index_for_empty >= 0){
|
} else if (index_for_empty >= 0){
|
||||||
|
new_entry = true;
|
||||||
index_to_use = index_for_empty;
|
index_to_use = index_for_empty;
|
||||||
} else if (index_for_lowest_seq_nr >= 0){
|
} else if (index_for_lowest_seq_nr >= 0){
|
||||||
index_to_use = index_for_lowest_seq_nr;
|
index_to_use = index_for_lowest_seq_nr;
|
||||||
@ -268,8 +270,8 @@ int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk){
|
|||||||
// set in entry_mape
|
// set in entry_mape
|
||||||
entry_map[index_to_use] = 1;
|
entry_map[index_to_use] = 1;
|
||||||
|
|
||||||
// keep track - don't increase if old entry found
|
// keep track - don't increase if old entry found or replaced
|
||||||
if (index_for_addr < 0){
|
if (new_entry){
|
||||||
num_valid_entries++;
|
num_valid_entries++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user