From 324f7e9cecebea0d19a063d4c829f998f1c7e156 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Sun, 27 Sep 2020 00:24:48 -0700 Subject: [PATCH] Minor clean up in l2c_api Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: I4e7f7d610dba175c9d0abc3d23038891acf31242 --- stack/include/l2c_api.h | 2 -- stack/l2cap/l2c_api.cc | 14 +++----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/stack/include/l2c_api.h b/stack/include/l2c_api.h index becd7cacd..ab29e1589 100644 --- a/stack/include/l2c_api.h +++ b/stack/include/l2c_api.h @@ -680,8 +680,6 @@ extern bool L2CA_RegisterFixedChannel(uint16_t fixed_cid, ******************************************************************************/ extern bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& bd_addr); -extern bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& bd_addr, - uint8_t initiating_phys); /******************************************************************************* * diff --git a/stack/l2cap/l2c_api.cc b/stack/l2cap/l2c_api.cc index 5bf7aefaf..7fa972aee 100644 --- a/stack/l2cap/l2c_api.cc +++ b/stack/l2cap/l2c_api.cc @@ -947,7 +947,7 @@ bool L2CA_SetTxPriority(uint16_t cid, tL2CAP_CHNL_PRIORITY priority) { * NOTE This flush timeout applies to all logical channels active on * the ACL link. ******************************************************************************/ -inline uint32_t ConvertMillisecondsToBasebandSlots(uint32_t milliseconds) { +constexpr uint32_t ConvertMillisecondsToBasebandSlots(uint32_t milliseconds) { return ((milliseconds * 8) + 3) / 5; } @@ -1098,16 +1098,8 @@ bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) { if (bluetooth::shim::is_gd_shim_enabled()) { return bluetooth::shim::L2CA_ConnectFixedChnl(fixed_cid, rem_bda); } - uint8_t phy = controller_get_interface()->get_le_all_initiating_phys(); - return L2CA_ConnectFixedChnl(fixed_cid, rem_bda, phy); -} - -bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda, - uint8_t initiating_phys) { - if (bluetooth::shim::is_gd_shim_enabled()) { - return bluetooth::shim::L2CA_ConnectFixedChnl(fixed_cid, rem_bda, - initiating_phys); - } + uint8_t initiating_phys = + controller_get_interface()->get_le_all_initiating_phys(); tL2C_LCB* p_lcb; tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR; -- 2.11.0