Lines Matching refs:tcb
260 if (gatt_cb.tcb[i].in_use && gatt_cb.tcb[i].ch_state == GATT_CH_OPEN) { in gatt_find_the_connected_bda()
261 bda = gatt_cb.tcb[i].peer_bda; in gatt_find_the_connected_bda()
263 *p_transport = gatt_cb.tcb[i].transport; in gatt_find_the_connected_bda()
350 if (gatt_cb.tcb[i].in_use && gatt_cb.tcb[i].peer_bda == bda) { in gatt_is_bda_connected()
372 if (gatt_cb.tcb[i].peer_bda == bda && in gatt_find_i_tcb_by_addr()
373 gatt_cb.tcb[i].transport == transport) { in gatt_find_i_tcb_by_addr()
392 if ((tcb_idx < GATT_MAX_PHY_CHANNEL) && gatt_cb.tcb[tcb_idx].in_use) in gatt_get_tcb_by_idx()
393 p_tcb = &gatt_cb.tcb[tcb_idx]; in gatt_get_tcb_by_idx()
413 if (i != GATT_INDEX_INVALID) p_tcb = &gatt_cb.tcb[i]; in gatt_find_tcb_by_addr()
431 if (j != GATT_INDEX_INVALID) return &gatt_cb.tcb[j]; in gatt_allocate_tcb_by_bdaddr()
435 tGATT_TCB* p_tcb = &gatt_cb.tcb[i]; in gatt_allocate_tcb_by_bdaddr()
588 void gatt_stop_conf_timer(tGATT_TCB& tcb, uint16_t cid) { in gatt_stop_conf_timer() argument
590 if (tcb.eatt && cid != L2CAP_ATT_CID) in gatt_stop_conf_timer()
591 EattExtension::GetInstance()->StopIndicationConfirmationTimer(tcb.peer_bda, cid); in gatt_stop_conf_timer()
593 alarm_cancel(tcb.conf_timer); in gatt_stop_conf_timer()
605 void gatt_start_ind_ack_timer(tGATT_TCB& tcb, uint16_t cid) { in gatt_start_ind_ack_timer() argument
607 if (tcb.eatt && cid != L2CAP_ATT_CID) in gatt_start_ind_ack_timer()
608 EattExtension::GetInstance()->StartAppIndicationTimer(tcb.peer_bda, cid); in gatt_start_ind_ack_timer()
610 alarm_set_on_mloop(tcb.ind_ack_timer, GATT_WAIT_FOR_RSP_TIMEOUT_MS, in gatt_start_ind_ack_timer()
611 gatt_ind_ack_timeout, &tcb); in gatt_start_ind_ack_timer()
666 extern void gatts_proc_srv_chg_ind_ack(tGATT_TCB tcb);
803 tGATT_STATUS gatt_send_error_rsp(tGATT_TCB& tcb, uint16_t cid, uint8_t err_code, in gatt_send_error_rsp() argument
813 p_buf = attp_build_sr_msg(tcb, GATT_RSP_ERROR, &msg); in gatt_send_error_rsp()
815 status = attp_send_sr_msg(tcb, cid, p_buf); in gatt_send_error_rsp()
820 gatt_dequeue_sr_cmd(tcb, cid); in gatt_send_error_rsp()
979 bool gatt_tcb_is_cid_busy(tGATT_TCB& tcb, uint16_t cid) { in gatt_tcb_is_cid_busy() argument
980 if (cid == tcb.att_lcid) return !tcb.cl_cmd_q.empty(); in gatt_tcb_is_cid_busy()
983 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_tcb_is_cid_busy()
1067 bool gatt_tcb_find_indicate_handle(tGATT_TCB& tcb, uint16_t cid, in gatt_tcb_find_indicate_handle() argument
1069 if (cid == tcb.att_lcid) { in gatt_tcb_find_indicate_handle()
1070 *indicated_handle_p = tcb.indicate_handle; in gatt_tcb_find_indicate_handle()
1071 tcb.indicate_handle = 0; in gatt_tcb_find_indicate_handle()
1075 if (tcb.eatt) { in gatt_tcb_find_indicate_handle()
1077 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_tcb_find_indicate_handle()
1098 uint16_t gatt_tcb_get_att_cid(tGATT_TCB& tcb, bool eatt_support) { in gatt_tcb_get_att_cid() argument
1099 if (eatt_support && tcb.eatt) { in gatt_tcb_get_att_cid()
1101 EattExtension::GetInstance()->GetChannelAvailableForClientRequest(tcb.peer_bda); in gatt_tcb_get_att_cid()
1106 return tcb.att_lcid; in gatt_tcb_get_att_cid()
1118 uint16_t gatt_tcb_get_payload_size_tx(tGATT_TCB& tcb, uint16_t cid) { in gatt_tcb_get_payload_size_tx() argument
1119 if (!tcb.eatt || (cid == tcb.att_lcid)) return tcb.payload_size; in gatt_tcb_get_payload_size_tx()
1122 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_tcb_get_payload_size_tx()
1137 uint16_t gatt_tcb_get_payload_size_rx(tGATT_TCB& tcb, uint16_t cid) { in gatt_tcb_get_payload_size_rx() argument
1138 if (!tcb.eatt || (cid == tcb.att_lcid)) return tcb.payload_size; in gatt_tcb_get_payload_size_rx()
1141 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_tcb_get_payload_size_rx()
1178 if (gatt_cb.tcb[xx].in_use && in gatt_find_tcb_by_cid()
1179 ((gatt_cb.tcb[xx].att_lcid == lcid) || in gatt_find_tcb_by_cid()
1180 ((EattExtension::GetInstance()->FindEattChannelByCid(gatt_cb.tcb[xx].peer_bda, in gatt_find_tcb_by_cid()
1182 p_tcb = &gatt_cb.tcb[xx]; in gatt_find_tcb_by_cid()
1207 void gatt_sr_copy_prep_cnt_to_cback_cnt(tGATT_TCB& tcb) { in gatt_sr_copy_prep_cnt_to_cback_cnt() argument
1209 if (tcb.prep_cnt[i]) { in gatt_sr_copy_prep_cnt_to_cback_cnt()
1210 tcb.sr_cmd.cback_cnt[i] = 1; in gatt_sr_copy_prep_cnt_to_cback_cnt()
1236 bool gatt_sr_is_cback_cnt_zero(tGATT_TCB& tcb) { in gatt_sr_is_cback_cnt_zero() argument
1238 if (tcb.sr_cmd.cback_cnt[i]) { in gatt_sr_is_cback_cnt_zero()
1254 bool gatt_sr_is_prep_cnt_zero(tGATT_TCB& tcb) { in gatt_sr_is_prep_cnt_zero() argument
1256 if (tcb.prep_cnt[i]) { in gatt_sr_is_prep_cnt_zero()
1272 void gatt_sr_reset_cback_cnt(tGATT_TCB& tcb, uint16_t cid) { in gatt_sr_reset_cback_cnt() argument
1274 if (cid == tcb.att_lcid) { in gatt_sr_reset_cback_cnt()
1275 tcb.sr_cmd.cback_cnt[i] = 0; in gatt_sr_reset_cback_cnt()
1278 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_sr_reset_cback_cnt()
1293 void gatt_sr_reset_prep_cnt(tGATT_TCB& tcb) { in gatt_sr_reset_prep_cnt() argument
1295 tcb.prep_cnt[i] = 0; in gatt_sr_reset_prep_cnt()
1300 tGATT_SR_CMD* gatt_sr_get_cmd_by_cid(tGATT_TCB& tcb, uint16_t cid) { in gatt_sr_get_cmd_by_cid() argument
1303 LOG(INFO) << __func__ << " cid: " << int(cid) << " tcb cid " << tcb.att_lcid; in gatt_sr_get_cmd_by_cid()
1304 if (cid == tcb.att_lcid) { in gatt_sr_get_cmd_by_cid()
1305 sr_cmd_p = &tcb.sr_cmd; in gatt_sr_get_cmd_by_cid()
1308 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_sr_get_cmd_by_cid()
1316 tGATT_READ_MULTI* gatt_sr_get_read_multi(tGATT_TCB& tcb, uint16_t cid) { in gatt_sr_get_read_multi() argument
1319 LOG(INFO) << __func__ << " cid: " << int(cid) << " tcb cid " << tcb.att_lcid; in gatt_sr_get_read_multi()
1320 if (cid == tcb.att_lcid) { in gatt_sr_get_read_multi()
1321 read_multi_p = &tcb.sr_cmd.multi_req; in gatt_sr_get_read_multi()
1324 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_sr_get_read_multi()
1340 void gatt_sr_update_cback_cnt(tGATT_TCB& tcb, uint16_t cid, tGATT_IF gatt_if, in gatt_sr_update_cback_cnt() argument
1345 if (cid == tcb.att_lcid) { in gatt_sr_update_cback_cnt()
1346 sr_cmd_p = &tcb.sr_cmd; in gatt_sr_update_cback_cnt()
1349 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_sr_update_cback_cnt()
1354 gatt_sr_reset_cback_cnt(tcb, cid); in gatt_sr_update_cback_cnt()
1374 void gatt_sr_update_prep_cnt(tGATT_TCB& tcb, tGATT_IF gatt_if, bool is_inc, in gatt_sr_update_prep_cnt() argument
1380 tcb.tcb_idx, gatt_if, is_inc, is_reset_first); in gatt_sr_update_prep_cnt()
1383 gatt_sr_reset_prep_cnt(tcb); in gatt_sr_update_prep_cnt()
1386 tcb.prep_cnt[idx]++; in gatt_sr_update_prep_cnt()
1388 if (tcb.prep_cnt[idx]) { in gatt_sr_update_prep_cnt()
1389 tcb.prep_cnt[idx]--; in gatt_sr_update_prep_cnt()
1413 void gatt_cmd_enq(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, bool to_send, in gatt_cmd_enq() argument
1422 if (p_clcb->cid == tcb.att_lcid) { in gatt_cmd_enq()
1423 tcb.cl_cmd_q.push(cmd); in gatt_cmd_enq()
1426 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cmd.cid); in gatt_cmd_enq()
1433 tGATT_CLCB* gatt_cmd_dequeue(tGATT_TCB& tcb, uint16_t cid, uint8_t* p_op_code) { in gatt_cmd_dequeue() argument
1436 if (cid == tcb.att_lcid) { in gatt_cmd_dequeue()
1437 cl_cmd_q_p = &tcb.cl_cmd_q; in gatt_cmd_dequeue()
1440 EattExtension::GetInstance()->FindEattChannelByCid(tcb.peer_bda, cid); in gatt_cmd_dequeue()
1457 tGATT_STATUS gatt_send_write_msg(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, in gatt_send_write_msg() argument
1467 return attp_send_cl_msg(tcb, p_clcb, op_code, &msg); in gatt_send_write_msg()