Lines Matching refs:p_tcb

89 void gatt_free_pending_ind(tGATT_TCB* p_tcb) {  in gatt_free_pending_ind()  argument
92 if (p_tcb->pending_ind_q == NULL) return; in gatt_free_pending_ind()
95 while (!fixed_queue_is_empty(p_tcb->pending_ind_q)) in gatt_free_pending_ind()
96 osi_free(fixed_queue_try_dequeue(p_tcb->pending_ind_q)); in gatt_free_pending_ind()
97 fixed_queue_free(p_tcb->pending_ind_q, NULL); in gatt_free_pending_ind()
98 p_tcb->pending_ind_q = NULL; in gatt_free_pending_ind()
168 tGATT_VALUE* gatt_add_pending_ind(tGATT_TCB* p_tcb, tGATT_VALUE* p_ind) { in gatt_add_pending_ind() argument
174 fixed_queue_enqueue(p_tcb->pending_ind_q, p_buf); in gatt_add_pending_ind()
290 bool gatt_is_srv_chg_ind_pending(tGATT_TCB* p_tcb) { in gatt_is_srv_chg_ind_pending() argument
292 << " is_queue_empty=" << fixed_queue_is_empty(p_tcb->pending_ind_q); in gatt_is_srv_chg_ind_pending()
294 if (p_tcb->indicate_handle == gatt_cb.handle_of_h_r) return true; in gatt_is_srv_chg_ind_pending()
296 if (fixed_queue_is_empty(p_tcb->pending_ind_q)) return false; in gatt_is_srv_chg_ind_pending()
298 list_t* list = fixed_queue_get_list(p_tcb->pending_ind_q); in gatt_is_srv_chg_ind_pending()
394 tGATT_TCB* p_tcb = NULL; in gatt_get_tcb_by_idx() local
397 p_tcb = &gatt_cb.tcb[tcb_idx]; in gatt_get_tcb_by_idx()
399 return p_tcb; in gatt_get_tcb_by_idx()
413 tGATT_TCB* p_tcb = NULL; in gatt_find_tcb_by_addr() local
417 if (i != GATT_INDEX_INVALID) p_tcb = &gatt_cb.tcb[i]; in gatt_find_tcb_by_addr()
419 return p_tcb; in gatt_find_tcb_by_addr()
439 tGATT_TCB* p_tcb = &gatt_cb.tcb[i]; in gatt_allocate_tcb_by_bdaddr() local
440 if (p_tcb->in_use) continue; in gatt_allocate_tcb_by_bdaddr()
442 *p_tcb = tGATT_TCB(); in gatt_allocate_tcb_by_bdaddr()
444 p_tcb->pending_ind_q = fixed_queue_new(SIZE_MAX); in gatt_allocate_tcb_by_bdaddr()
445 p_tcb->conf_timer = alarm_new("gatt.conf_timer"); in gatt_allocate_tcb_by_bdaddr()
446 p_tcb->ind_ack_timer = alarm_new("gatt.ind_ack_timer"); in gatt_allocate_tcb_by_bdaddr()
447 p_tcb->in_use = true; in gatt_allocate_tcb_by_bdaddr()
448 p_tcb->tcb_idx = i; in gatt_allocate_tcb_by_bdaddr()
449 p_tcb->transport = transport; in gatt_allocate_tcb_by_bdaddr()
450 p_tcb->peer_bda = bda; in gatt_allocate_tcb_by_bdaddr()
451 return p_tcb; in gatt_allocate_tcb_by_bdaddr()
557 void gatt_start_conf_timer(tGATT_TCB* p_tcb) { in gatt_start_conf_timer() argument
558 alarm_set_on_mloop(p_tcb->conf_timer, GATT_WAIT_FOR_RSP_TIMEOUT_MS, in gatt_start_conf_timer()
559 gatt_indication_confirmation_timeout, p_tcb); in gatt_start_conf_timer()
589 if (p_clcb == NULL || p_clcb->p_tcb == NULL) { in gatt_rsp_timeout()
598 if (p_clcb != gatt_cmd_dequeue(*p_clcb->p_tcb, &rsp_code)) { in gatt_rsp_timeout()
608 gatt_disconnect(p_clcb->p_tcb); in gatt_rsp_timeout()
621 tGATT_TCB* p_tcb = (tGATT_TCB*)data; in gatt_indication_confirmation_timeout() local
624 gatt_disconnect(p_tcb); in gatt_indication_confirmation_timeout()
637 tGATT_TCB* p_tcb = (tGATT_TCB*)data; in gatt_ind_ack_timeout() local
638 CHECK(p_tcb); in gatt_ind_ack_timeout()
641 p_tcb->ind_count = 0; in gatt_ind_ack_timeout()
642 attp_send_cl_msg(*p_tcb, nullptr, GATT_HANDLE_VALUE_CONF, NULL); in gatt_ind_ack_timeout()
895 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in gatt_clcb_alloc() local
905 p_clcb->p_tcb = p_tcb; in gatt_clcb_alloc()
942 tGATT_TCB* p_tcb = NULL; in gatt_find_tcb_by_cid() local
946 p_tcb = &gatt_cb.tcb[xx]; in gatt_find_tcb_by_cid()
950 return p_tcb; in gatt_find_tcb_by_cid()
966 if (gatt_cb.clcb[i].in_use && gatt_cb.clcb[i].p_tcb->peer_bda == bda) num++; in gatt_num_clcb_by_bd_addr()
1108 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bda, BT_TRANSPORT_LE); in gatt_cancel_open() local
1109 if (!p_tcb) return true; in gatt_cancel_open()
1111 if (gatt_get_ch_state(p_tcb) == GATT_CH_OPEN) { in gatt_cancel_open()
1116 gatt_update_app_use_link_flag(gatt_if, p_tcb, false, false); in gatt_cancel_open()
1118 if (p_tcb->app_hold_link.empty()) gatt_disconnect(p_tcb); in gatt_cancel_open()
1213 cb_data.mtu = p_clcb->p_tcb->payload_size; in gatt_end_operation()
1244 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bda, transport); in gatt_cleanup_upon_disc() local
1245 if (!p_tcb) return; in gatt_cleanup_upon_disc()
1247 gatt_set_ch_state(p_tcb, GATT_CH_CLOSE); in gatt_cleanup_upon_disc()
1250 if (!p_clcb->in_use || p_clcb->p_tcb != p_tcb) continue; in gatt_cleanup_upon_disc()
1262 alarm_free(p_tcb->ind_ack_timer); in gatt_cleanup_upon_disc()
1263 p_tcb->ind_ack_timer = NULL; in gatt_cleanup_upon_disc()
1264 alarm_free(p_tcb->conf_timer); in gatt_cleanup_upon_disc()
1265 p_tcb->conf_timer = NULL; in gatt_cleanup_upon_disc()
1266 gatt_free_pending_ind(p_tcb); in gatt_cleanup_upon_disc()
1267 fixed_queue_free(p_tcb->sr_cmd.multi_rsp_q, NULL); in gatt_cleanup_upon_disc()
1268 p_tcb->sr_cmd.multi_rsp_q = NULL; in gatt_cleanup_upon_disc()
1273 uint16_t conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, p_reg->gatt_if); in gatt_cleanup_upon_disc()
1275 p_tcb->tcb_idx, p_reg->gatt_if, conn_id); in gatt_cleanup_upon_disc()
1281 *p_tcb = tGATT_TCB(); in gatt_cleanup_upon_disc()
1365 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE); in gatt_remove_bg_dev_for_app() local
1368 if (p_tcb) gatt_update_app_use_link_flag(gatt_if, p_tcb, false, false); in gatt_remove_bg_dev_for_app()
1444 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE); in gatt_update_auto_connect_dev() local
1457 if (ret && p_tcb != NULL) { in gatt_update_auto_connect_dev()
1459 gatt_update_app_use_link_flag(gatt_if, p_tcb, true, true); in gatt_update_auto_connect_dev()