Loading system/stack/smp/smp_l2c.cc +1 −18 Original line number Diff line number Diff line Loading @@ -208,24 +208,7 @@ static void smp_data_received(uint16_t channel, const RawAddress& bd_addr, * Description SMP channel tx complete callback * ******************************************************************************/ static void smp_tx_complete_callback(uint16_t cid, uint16_t num_pkt) { tSMP_CB* p_cb = &smp_cb; if (p_cb->total_tx_unacked >= num_pkt) p_cb->total_tx_unacked -= num_pkt; else SMP_TRACE_ERROR("Unexpected %s: num_pkt = %d", __func__, num_pkt); if (p_cb->total_tx_unacked == 0 && p_cb->wait_for_authorization_complete) { tSMP_INT_DATA smp_int_data; smp_int_data.status = SMP_SUCCESS; if (cid == L2CAP_SMP_CID) { smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data); } else { smp_br_state_machine_event(p_cb, SMP_BR_AUTH_CMPL_EVT, &smp_int_data); } } } static void smp_tx_complete_callback(uint16_t cid, uint16_t num_pkt) {} /******************************************************************************* * Loading system/stack/smp/smp_utils.cc +13 −3 Original line number Diff line number Diff line Loading @@ -340,19 +340,29 @@ bool smp_send_msg_to_L2CAP(const RawAddress& rem_bda, BT_HDR* p_toL2CAP) { } SMP_TRACE_EVENT("%s", __func__); smp_cb.total_tx_unacked += 1; smp_log_metrics(rem_bda, true /* outgoing */, p_toL2CAP->data + p_toL2CAP->offset, p_toL2CAP->len); l2cap_ret = L2CA_SendFixedChnlData(fixed_cid, rem_bda, p_toL2CAP); if (l2cap_ret == L2CAP_DW_FAILED) { smp_cb.total_tx_unacked -= 1; SMP_TRACE_ERROR("SMP failed to pass msg to L2CAP"); return false; } else } else { tSMP_CB* p_cb = &smp_cb; if (p_cb->wait_for_authorization_complete) { tSMP_INT_DATA smp_int_data; smp_int_data.status = SMP_SUCCESS; if (fixed_cid == L2CAP_SMP_CID) { smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data); } else { smp_br_state_machine_event(p_cb, SMP_BR_AUTH_CMPL_EVT, &smp_int_data); } } return true; } } /******************************************************************************* * Loading Loading
system/stack/smp/smp_l2c.cc +1 −18 Original line number Diff line number Diff line Loading @@ -208,24 +208,7 @@ static void smp_data_received(uint16_t channel, const RawAddress& bd_addr, * Description SMP channel tx complete callback * ******************************************************************************/ static void smp_tx_complete_callback(uint16_t cid, uint16_t num_pkt) { tSMP_CB* p_cb = &smp_cb; if (p_cb->total_tx_unacked >= num_pkt) p_cb->total_tx_unacked -= num_pkt; else SMP_TRACE_ERROR("Unexpected %s: num_pkt = %d", __func__, num_pkt); if (p_cb->total_tx_unacked == 0 && p_cb->wait_for_authorization_complete) { tSMP_INT_DATA smp_int_data; smp_int_data.status = SMP_SUCCESS; if (cid == L2CAP_SMP_CID) { smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data); } else { smp_br_state_machine_event(p_cb, SMP_BR_AUTH_CMPL_EVT, &smp_int_data); } } } static void smp_tx_complete_callback(uint16_t cid, uint16_t num_pkt) {} /******************************************************************************* * Loading
system/stack/smp/smp_utils.cc +13 −3 Original line number Diff line number Diff line Loading @@ -340,19 +340,29 @@ bool smp_send_msg_to_L2CAP(const RawAddress& rem_bda, BT_HDR* p_toL2CAP) { } SMP_TRACE_EVENT("%s", __func__); smp_cb.total_tx_unacked += 1; smp_log_metrics(rem_bda, true /* outgoing */, p_toL2CAP->data + p_toL2CAP->offset, p_toL2CAP->len); l2cap_ret = L2CA_SendFixedChnlData(fixed_cid, rem_bda, p_toL2CAP); if (l2cap_ret == L2CAP_DW_FAILED) { smp_cb.total_tx_unacked -= 1; SMP_TRACE_ERROR("SMP failed to pass msg to L2CAP"); return false; } else } else { tSMP_CB* p_cb = &smp_cb; if (p_cb->wait_for_authorization_complete) { tSMP_INT_DATA smp_int_data; smp_int_data.status = SMP_SUCCESS; if (fixed_cid == L2CAP_SMP_CID) { smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data); } else { smp_br_state_machine_event(p_cb, SMP_BR_AUTH_CMPL_EVT, &smp_int_data); } } return true; } } /******************************************************************************* * Loading