OSDN Git Service

gap_credits_received_cb is no longer useful
authorHansong Zhang <hsz@google.com>
Thu, 27 Aug 2020 22:52:47 +0000 (15:52 -0700)
committerHansong Zhang <hsz@google.com>
Thu, 27 Aug 2020 22:59:12 +0000 (15:59 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I38779d4d17ba7c1f403e83a61bb269cd361a7c7f

stack/gap/gap_conn.cc
stack/include/gap_api.h

index 655e5c5..fa409b4 100644 (file)
@@ -91,10 +91,6 @@ static void gap_disconnect_ind(uint16_t l2cap_cid, bool ack_needed);
 static void gap_data_ind(uint16_t l2cap_cid, BT_HDR* p_msg);
 static void gap_congestion_ind(uint16_t lcid, bool is_congested);
 static void gap_tx_complete_ind(uint16_t l2cap_cid, uint16_t sdu_sent);
-static void gap_credits_received_cb(uint16_t l2cap_cid,
-                                    uint16_t credits_received,
-                                    uint16_t credit_count);
-
 static tGAP_CCB* gap_find_ccb_by_cid(uint16_t cid);
 static tGAP_CCB* gap_find_ccb_by_handle(uint16_t handle);
 static tGAP_CCB* gap_allocate_ccb(void);
@@ -122,7 +118,7 @@ void gap_conn_init(void) {
   conn.reg_info.pL2CA_DataInd_Cb = gap_data_ind;
   conn.reg_info.pL2CA_CongestionStatus_Cb = gap_congestion_ind;
   conn.reg_info.pL2CA_TxComplete_Cb = gap_tx_complete_ind;
-  conn.reg_info.pL2CA_CreditsReceived_Cb = gap_credits_received_cb;
+  conn.reg_info.pL2CA_CreditsReceived_Cb = NULL;
 }
 
 /*******************************************************************************
@@ -588,16 +584,6 @@ void gap_tx_complete_ind(uint16_t l2cap_cid, uint16_t sdu_sent) {
   }
 }
 
-void gap_credits_received_cb(uint16_t l2cap_cid, uint16_t credits_received,
-                             uint16_t credit_count) {
-  tGAP_CCB* p_ccb = gap_find_ccb_by_cid(l2cap_cid);
-  if (!p_ccb) return;
-
-  tGAP_CB_DATA data{.coc_credits = {.credits_received = credits_received,
-                                    .credit_count = credit_count}};
-  p_ccb->p_callback(p_ccb->gap_handle, GAP_EVT_LE_COC_CREDITS, &data);
-}
-
 /*******************************************************************************
  *
  * Function         gap_connect_ind
index 08d58cc..7c56dd8 100644 (file)
@@ -43,7 +43,6 @@
 #define GAP_EVT_CONN_CONGESTED 0x0103
 #define GAP_EVT_CONN_UNCONGESTED 0x0104
 #define GAP_EVT_TX_EMPTY 0x0105
-#define GAP_EVT_LE_COC_CREDITS 0x0106
 
 /* Values for 'chan_mode_mask' field */
 /* GAP_ConnOpen() - optional channels to negotiate */