From c8e79a926620e48830778714cfe4b2ea2453fcaf Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 25 Jul 2025 13:33:07 +1000 Subject: Update forked idf components --- lib/bt/host/bluedroid/stack/smp/smp_act.c | 12 ++++++++++-- lib/bt/host/bluedroid/stack/smp/smp_utils.c | 5 ++--- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'lib/bt/host/bluedroid/stack/smp') diff --git a/lib/bt/host/bluedroid/stack/smp/smp_act.c b/lib/bt/host/bluedroid/stack/smp/smp_act.c index 0e7dcd5b..43b2e476 100644 --- a/lib/bt/host/bluedroid/stack/smp/smp_act.c +++ b/lib/bt/host/bluedroid/stack/smp/smp_act.c @@ -1553,7 +1553,7 @@ void smp_fast_conn_param(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) } /* Disable L2CAP connection parameter updates while bonding since some peripherals are not able to revert to fast connection parameters - during the start of service discovery. Connection paramter updates + during the start of service discovery. Connection parameter updates get enabled again once service discovery completes. */ #if (BT_MULTI_CONNECTION_ENBALE == FALSE) L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, FALSE); @@ -1648,6 +1648,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) /* slave calculates and sends local commitment */ smp_calculate_local_commitment(p_cb); smp_send_commitment(p_cb, NULL); + /* Ensure the connection is still active */ + if (smp_get_state() == SMP_STATE_IDLE) return; /* slave has to wait for peer nonce */ smp_set_state(SMP_STATE_WAIT_NONCE); } else { /* i.e. master */ @@ -1658,6 +1660,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) p_cb->selected_association_model); p_cb->flags &= ~SMP_PAIR_FLAG_HAVE_PEER_COMM; smp_send_rand(p_cb, NULL); + /* Ensure the connection is still active */ + if (smp_get_state() == SMP_STATE_IDLE) return; smp_set_state(SMP_STATE_WAIT_NONCE); } } @@ -1672,6 +1676,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) if (p_cb->flags & SMP_PAIR_FLAG_HAVE_PEER_COMM) { /* master commitment is already received */ smp_send_commitment(p_cb, NULL); + /* Ensure the connection is still active */ + if (smp_get_state() == SMP_STATE_IDLE) return; smp_set_state(SMP_STATE_WAIT_NONCE); } } @@ -1679,6 +1685,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) case SMP_MODEL_SEC_CONN_OOB: if (p_cb->role == HCI_ROLE_MASTER) { smp_send_rand(p_cb, NULL); + /* Ensure the connection is still active */ + if (smp_get_state() == SMP_STATE_IDLE) return; } smp_set_state(SMP_STATE_WAIT_NONCE); @@ -2002,7 +2010,7 @@ void smp_link_encrypted(BD_ADDR bda, UINT8 encr_enable) SMP_TRACE_DEBUG("%s encr_enable=%d\n", __func__, encr_enable); if (memcmp(&smp_cb.pairing_bda[0], bda, BD_ADDR_LEN) == 0) { - /* encryption completed with STK, remmeber the key size now, could be overwite + /* encryption completed with STK, remember the key size now, could be overwrite * when key exchange happens */ if (p_cb->loc_enc_size != 0 && encr_enable) { /* update the link encryption key size if a SMP pairing just performed */ diff --git a/lib/bt/host/bluedroid/stack/smp/smp_utils.c b/lib/bt/host/bluedroid/stack/smp/smp_utils.c index 2e9fac77..48ba6c0a 100644 --- a/lib/bt/host/bluedroid/stack/smp/smp_utils.c +++ b/lib/bt/host/bluedroid/stack/smp/smp_utils.c @@ -331,8 +331,7 @@ BOOLEAN smp_send_msg_to_L2CAP(BD_ADDR rem_bda, BT_HDR *p_toL2CAP) if ((l2cap_ret = L2CA_SendFixedChnlData (fixed_cid, rem_bda, p_toL2CAP)) == L2CAP_DW_FAILED) { smp_cb.total_tx_unacked -= 1; - SMP_TRACE_ERROR("SMP failed to pass msg:0x%0x to L2CAP", - *((UINT8 *)(p_toL2CAP + 1) + p_toL2CAP->offset)); + SMP_TRACE_ERROR("SMP failed to pass msg to L2CAP"); return FALSE; } else { return TRUE; @@ -1125,7 +1124,7 @@ BOOLEAN smp_pairing_request_response_parameters_are_valid(tSMP_CB *p_cb) SMP_TRACE_DEBUG("%s for cmd code 0x%02x\n", __func__, p_cb->rcvd_cmd_code); if (io_caps >= BTM_IO_CAP_MAX) { - SMP_TRACE_WARNING("Rcvd from the peer cmd 0x%02x with IO Capabilty \ + SMP_TRACE_WARNING("Rcvd from the peer cmd 0x%02x with IO Capability \ value (0x%02x) out of range).\n", p_cb->rcvd_cmd_code, io_caps); return FALSE; -- cgit v1.2.3