Loading system/stack/avdt/avdt_ad.cc +7 −6 Original line number Diff line number Diff line Loading @@ -568,11 +568,11 @@ void avdt_ad_open_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb, uint8_t ro * ******************************************************************************/ void avdt_ad_close_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb) { uint8_t tcid; uint16_t lcid; AvdtpTransportChannel* p_tbl; p_tbl = avdt_ad_tc_tbl_by_type(type, p_ccb, p_scb); log::verbose("avdt_ad_close_req state: {}", p_tbl->state); log::verbose("state: {}", p_tbl->state); switch (p_tbl->state) { case AVDT_AD_ST_UNUSED: Loading @@ -583,10 +583,11 @@ void avdt_ad_close_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb) { avdt_ad_tc_close_ind(p_tbl); break; default: /* get tcid from type, scb */ tcid = avdt_ad_type_to_tcid(type, p_scb); lcid = p_tbl->lcid; /* call l2cap disconnect req */ avdt_l2c_disconnect(avdtp_cb.ad.rt_tbl[avdt_ccb_to_idx(p_ccb)][tcid].lcid); if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP lcid: 0x{:04x}", lcid); } avdt_ad_tc_close_ind(p_tbl); } } system/stack/avdt/avdt_int.h +0 −2 Original line number Diff line number Diff line Loading @@ -950,8 +950,6 @@ extern const tL2CAP_APPL_INFO avdt_l2c_appl; /* reject message event lookup table */ extern const uint8_t avdt_msg_rej_2_evt[]; void avdt_l2c_disconnect(uint16_t lcid); constexpr uint16_t kAvdtpMtu = 1024; #endif /* AVDT_INT_H */ system/stack/avdt/avdt_l2c.cc +16 −16 Original line number Diff line number Diff line Loading @@ -216,7 +216,22 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl->state = AVDT_AD_ST_CFG; } static void avdt_on_l2cap_error(uint16_t lcid, uint16_t /* result */) { avdt_l2c_disconnect(lcid); } static void avdt_on_l2cap_error(uint16_t lcid, uint16_t result) { AvdtpTransportChannel* p_tbl; log::warn("lcid: 0x{:04x}, result: {}", lcid, to_l2cap_result_code(result)); if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP lcid: 0x{:04x}", lcid); } /* look up info for this channel */ p_tbl = avdt_ad_tc_tbl_by_lcid(lcid); if (p_tbl == NULL) { log::warn("Adaptation layer transport channel table is NULL"); return; } avdt_ad_tc_close_ind(p_tbl); } /******************************************************************************* * Loading Loading @@ -354,21 +369,6 @@ void avdt_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed) { } } void avdt_l2c_disconnect(uint16_t lcid) { if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP cid:{}", lcid); } AvdtpTransportChannel* p_tbl; log::verbose("avdt_l2c_disconnect_cfm_cback lcid: {}", lcid); /* look up info for this channel */ p_tbl = avdt_ad_tc_tbl_by_lcid(lcid); if (p_tbl != NULL) { avdt_ad_tc_close_ind(p_tbl); } } /******************************************************************************* * * Function avdt_l2c_congestion_ind_cback Loading Loading
system/stack/avdt/avdt_ad.cc +7 −6 Original line number Diff line number Diff line Loading @@ -568,11 +568,11 @@ void avdt_ad_open_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb, uint8_t ro * ******************************************************************************/ void avdt_ad_close_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb) { uint8_t tcid; uint16_t lcid; AvdtpTransportChannel* p_tbl; p_tbl = avdt_ad_tc_tbl_by_type(type, p_ccb, p_scb); log::verbose("avdt_ad_close_req state: {}", p_tbl->state); log::verbose("state: {}", p_tbl->state); switch (p_tbl->state) { case AVDT_AD_ST_UNUSED: Loading @@ -583,10 +583,11 @@ void avdt_ad_close_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb) { avdt_ad_tc_close_ind(p_tbl); break; default: /* get tcid from type, scb */ tcid = avdt_ad_type_to_tcid(type, p_scb); lcid = p_tbl->lcid; /* call l2cap disconnect req */ avdt_l2c_disconnect(avdtp_cb.ad.rt_tbl[avdt_ccb_to_idx(p_ccb)][tcid].lcid); if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP lcid: 0x{:04x}", lcid); } avdt_ad_tc_close_ind(p_tbl); } }
system/stack/avdt/avdt_int.h +0 −2 Original line number Diff line number Diff line Loading @@ -950,8 +950,6 @@ extern const tL2CAP_APPL_INFO avdt_l2c_appl; /* reject message event lookup table */ extern const uint8_t avdt_msg_rej_2_evt[]; void avdt_l2c_disconnect(uint16_t lcid); constexpr uint16_t kAvdtpMtu = 1024; #endif /* AVDT_INT_H */
system/stack/avdt/avdt_l2c.cc +16 −16 Original line number Diff line number Diff line Loading @@ -216,7 +216,22 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl->state = AVDT_AD_ST_CFG; } static void avdt_on_l2cap_error(uint16_t lcid, uint16_t /* result */) { avdt_l2c_disconnect(lcid); } static void avdt_on_l2cap_error(uint16_t lcid, uint16_t result) { AvdtpTransportChannel* p_tbl; log::warn("lcid: 0x{:04x}, result: {}", lcid, to_l2cap_result_code(result)); if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP lcid: 0x{:04x}", lcid); } /* look up info for this channel */ p_tbl = avdt_ad_tc_tbl_by_lcid(lcid); if (p_tbl == NULL) { log::warn("Adaptation layer transport channel table is NULL"); return; } avdt_ad_tc_close_ind(p_tbl); } /******************************************************************************* * Loading Loading @@ -354,21 +369,6 @@ void avdt_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed) { } } void avdt_l2c_disconnect(uint16_t lcid) { if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP cid:{}", lcid); } AvdtpTransportChannel* p_tbl; log::verbose("avdt_l2c_disconnect_cfm_cback lcid: {}", lcid); /* look up info for this channel */ p_tbl = avdt_ad_tc_tbl_by_lcid(lcid); if (p_tbl != NULL) { avdt_ad_tc_close_ind(p_tbl); } } /******************************************************************************* * * Function avdt_l2c_congestion_ind_cback Loading