le_device_db_fs, le_device_db_tlv: reset memory for new device

This commit is contained in:
Matthias Ringwald 2017-11-21 16:25:50 +01:00
parent 6c42608ae7
commit 539b14edca
2 changed files with 4 additions and 0 deletions

View File

@ -281,6 +281,8 @@ int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk){
log_info("Central Device DB adding type %u - %s", addr_type, bd_addr_to_str(addr));
log_info_key("irk", irk);
memset(&le_devices[index], 0, sizeof(le_device_memory_db_t));
le_devices[index].addr_type = addr_type;
memcpy(le_devices[index].addr, addr, 6);
memcpy(le_devices[index].irk, irk, 16);

View File

@ -234,6 +234,8 @@ int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk){
log_info("LE Device DB adding type %u - %s", addr_type, bd_addr_to_str(addr));
log_info_key("irk", irk);
memset(&le_devices[index], 0, sizeof(le_device_memory_db_t));
entry.addr_type = addr_type;
memcpy(entry.addr, addr, 6);
memcpy(entry.irk, irk, 16);