Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba747534 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

gap_credits_received_cb is no longer useful

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I38779d4d17ba7c1f403e83a61bb269cd361a7c7f
parent 4d536254
Loading
Loading
Loading
Loading
+1 −15
Original line number Diff line number Diff line
@@ -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
+0 −1
Original line number Diff line number Diff line
@@ -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 */