File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
connectivity/FEATURE_BLE/source/generic Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -164,16 +164,34 @@ ble_error_t PrivateAddressController::add_device_to_resolving_list(
164
164
peer_irk
165
165
);
166
166
} else {
167
+ // ensure an entry is not added twice
168
+ for (auto &entry : _resolving_list) {
169
+ if (entry.populated &&
170
+ entry.peer_address_type == peer_address_type &&
171
+ entry.peer_address == peer_identity_address &&
172
+ entry.peer_irk == peer_irk
173
+ ) {
174
+ return BLE_ERROR_NONE;
175
+ }
176
+ }
177
+
178
+ bool entry_added = false ;
167
179
for (auto &entry : _resolving_list) {
168
180
if (entry.populated == false ) {
169
181
entry.peer_address_type = peer_address_type;
170
182
entry.peer_address = peer_identity_address;
171
183
entry.peer_irk = peer_irk;
172
184
entry.populated = true ;
173
- return BLE_ERROR_NONE;
185
+ entry_added = true ;
186
+ break ;
174
187
}
175
188
}
176
189
190
+ if (!entry_added) {
191
+ return BLE_ERROR_NO_MEM;
192
+ }
193
+
194
+
177
195
// Remove unresolved entries from the resolved list
178
196
remove_resolution_entry_from_cache (
179
197
[&](resolution_entry_t &entry) {
You can’t perform that action at this time.
0 commit comments