diff --git a/nimble/host/src/ble_hs_hci.c b/nimble/host/src/ble_hs_hci.c index 70e4bc44f..c50b61321 100644 --- a/nimble/host/src/ble_hs_hci.c +++ b/nimble/host/src/ble_hs_hci.c @@ -325,12 +325,14 @@ ble_hs_hci_cmd_tx(uint16_t opcode, const void *cmd, uint8_t cmd_len, rc = ble_hs_hci_wait_for_ack(); if (rc != 0) { + BLE_HS_LOG(ERROR, "HCI wait for ack returned %d \n", rc); ble_hs_sched_reset(rc); goto done; } rc = ble_hs_hci_process_ack(opcode, rsp, rsp_len, &ack); if (rc != 0) { + BLE_HS_LOG(ERROR, "HCI process ack returned %d \n", rc); ble_hs_sched_reset(rc); goto done; } @@ -339,6 +341,7 @@ ble_hs_hci_cmd_tx(uint16_t opcode, const void *cmd, uint8_t cmd_len, /* on success we should always get full response */ if (!rc && (ack.bha_params_len != rsp_len)) { + BLE_HS_LOG(ERROR, "Received status %d \n", rc); ble_hs_sched_reset(rc); goto done; } diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c index 7409a9029..4752ebda0 100644 --- a/nimble/host/src/ble_sm.c +++ b/nimble/host/src/ble_sm.c @@ -615,8 +615,13 @@ ble_sm_persist_keys(struct ble_sm_proc *proc) ble_sm_fill_store_value(&peer_addr, authenticated, sc, &proc->peer_keys, &value_sec); ble_store_write_peer_sec(&value_sec); - value_rpa_rec.peer_addr=peer_addr; - value_rpa_rec.peer_rpa_addr=conn->bhc_peer_rpa_addr; + + value_rpa_rec.peer_addr.type = peer_addr.type; + memcpy(value_rpa_rec.peer_addr.val, peer_addr.val, sizeof peer_addr.val); + + value_rpa_rec.peer_rpa_addr.type = conn->bhc_peer_rpa_addr.type; + memcpy(value_rpa_rec.peer_rpa_addr.val, conn->bhc_peer_rpa_addr.val, sizeof conn->bhc_peer_rpa_addr.val); + ble_store_write_rpa_rec(&value_rpa_rec); }