Lines Matching refs:p_tcb

91 void gatt_free_pending_ind(tGATT_TCB* p_tcb) {  in gatt_free_pending_ind()  argument
94 if (p_tcb->pending_ind_q == NULL) return; in gatt_free_pending_ind()
97 while (!fixed_queue_is_empty(p_tcb->pending_ind_q)) in gatt_free_pending_ind()
98 osi_free(fixed_queue_try_dequeue(p_tcb->pending_ind_q)); in gatt_free_pending_ind()
99 fixed_queue_free(p_tcb->pending_ind_q, NULL); in gatt_free_pending_ind()
100 p_tcb->pending_ind_q = NULL; in gatt_free_pending_ind()
161 void gatt_add_pending_ind(tGATT_TCB* p_tcb, tGATT_VALUE* p_ind) { in gatt_add_pending_ind() argument
166 fixed_queue_enqueue(p_tcb->pending_ind_q, p_buf); in gatt_add_pending_ind()
280 bool gatt_is_srv_chg_ind_pending(tGATT_TCB* p_tcb) { in gatt_is_srv_chg_ind_pending() argument
282 << " is_queue_empty=" << fixed_queue_is_empty(p_tcb->pending_ind_q); in gatt_is_srv_chg_ind_pending()
284 if (p_tcb->indicate_handle == gatt_cb.handle_of_h_r) return true; in gatt_is_srv_chg_ind_pending()
286 if (fixed_queue_is_empty(p_tcb->pending_ind_q)) return false; in gatt_is_srv_chg_ind_pending()
288 list_t* list = fixed_queue_get_list(p_tcb->pending_ind_q); in gatt_is_srv_chg_ind_pending()
383 tGATT_TCB* p_tcb = NULL; in gatt_get_tcb_by_idx() local
386 p_tcb = &gatt_cb.tcb[tcb_idx]; in gatt_get_tcb_by_idx()
388 return p_tcb; in gatt_get_tcb_by_idx()
402 tGATT_TCB* p_tcb = NULL; in gatt_find_tcb_by_addr() local
406 if (i != GATT_INDEX_INVALID) p_tcb = &gatt_cb.tcb[i]; in gatt_find_tcb_by_addr()
408 return p_tcb; in gatt_find_tcb_by_addr()
428 tGATT_TCB* p_tcb = &gatt_cb.tcb[i]; in gatt_allocate_tcb_by_bdaddr() local
429 if (p_tcb->in_use) continue; in gatt_allocate_tcb_by_bdaddr()
431 *p_tcb = tGATT_TCB(); in gatt_allocate_tcb_by_bdaddr()
433 p_tcb->pending_ind_q = fixed_queue_new(SIZE_MAX); in gatt_allocate_tcb_by_bdaddr()
434 p_tcb->conf_timer = alarm_new("gatt.conf_timer"); in gatt_allocate_tcb_by_bdaddr()
435 p_tcb->ind_ack_timer = alarm_new("gatt.ind_ack_timer"); in gatt_allocate_tcb_by_bdaddr()
436 p_tcb->in_use = true; in gatt_allocate_tcb_by_bdaddr()
437 p_tcb->tcb_idx = i; in gatt_allocate_tcb_by_bdaddr()
438 p_tcb->transport = transport; in gatt_allocate_tcb_by_bdaddr()
439 p_tcb->peer_bda = bda; in gatt_allocate_tcb_by_bdaddr()
440 return p_tcb; in gatt_allocate_tcb_by_bdaddr()
546 void gatt_start_conf_timer(tGATT_TCB* p_tcb) { in gatt_start_conf_timer() argument
547 alarm_set_on_mloop(p_tcb->conf_timer, GATT_WAIT_FOR_RSP_TIMEOUT_MS, in gatt_start_conf_timer()
548 gatt_indication_confirmation_timeout, p_tcb); in gatt_start_conf_timer()
578 if (p_clcb == NULL || p_clcb->p_tcb == NULL) { in gatt_rsp_timeout()
587 if (p_clcb != gatt_cmd_dequeue(*p_clcb->p_tcb, &rsp_code)) { in gatt_rsp_timeout()
597 gatt_disconnect(p_clcb->p_tcb); in gatt_rsp_timeout()
612 tGATT_TCB* p_tcb = (tGATT_TCB*)data; in gatt_indication_confirmation_timeout() local
614 if (p_tcb->indicate_handle == gatt_cb.handle_of_h_r) { in gatt_indication_confirmation_timeout()
630 gatts_proc_srv_chg_ind_ack(*p_tcb); in gatt_indication_confirmation_timeout()
635 gatt_disconnect(p_tcb); in gatt_indication_confirmation_timeout()
648 tGATT_TCB* p_tcb = (tGATT_TCB*)data; in gatt_ind_ack_timeout() local
649 CHECK(p_tcb); in gatt_ind_ack_timeout()
652 p_tcb->ind_count = 0; in gatt_ind_ack_timeout()
653 attp_send_cl_msg(*p_tcb, nullptr, GATT_HANDLE_VALUE_CONF, NULL); in gatt_ind_ack_timeout()
906 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in gatt_clcb_alloc() local
916 p_clcb->p_tcb = p_tcb; in gatt_clcb_alloc()
953 tGATT_TCB* p_tcb = NULL; in gatt_find_tcb_by_cid() local
957 p_tcb = &gatt_cb.tcb[xx]; in gatt_find_tcb_by_cid()
961 return p_tcb; in gatt_find_tcb_by_cid()
977 if (gatt_cb.clcb[i].in_use && gatt_cb.clcb[i].p_tcb->peer_bda == bda) num++; in gatt_num_clcb_by_bd_addr()
1112 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bda, BT_TRANSPORT_LE); in gatt_cancel_open() local
1113 if (!p_tcb) return true; in gatt_cancel_open()
1115 if (gatt_get_ch_state(p_tcb) == GATT_CH_OPEN) { in gatt_cancel_open()
1120 gatt_update_app_use_link_flag(gatt_if, p_tcb, false, false); in gatt_cancel_open()
1122 if (p_tcb->app_hold_link.empty()) gatt_disconnect(p_tcb); in gatt_cancel_open()
1218 cb_data.mtu = p_clcb->p_tcb->payload_size; in gatt_end_operation()
1249 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bda, transport); in gatt_cleanup_upon_disc() local
1250 if (!p_tcb) return; in gatt_cleanup_upon_disc()
1252 gatt_set_ch_state(p_tcb, GATT_CH_CLOSE); in gatt_cleanup_upon_disc()
1255 if (!p_clcb->in_use || p_clcb->p_tcb != p_tcb) continue; in gatt_cleanup_upon_disc()
1267 alarm_free(p_tcb->ind_ack_timer); in gatt_cleanup_upon_disc()
1268 p_tcb->ind_ack_timer = NULL; in gatt_cleanup_upon_disc()
1269 alarm_free(p_tcb->conf_timer); in gatt_cleanup_upon_disc()
1270 p_tcb->conf_timer = NULL; in gatt_cleanup_upon_disc()
1271 gatt_free_pending_ind(p_tcb); in gatt_cleanup_upon_disc()
1272 fixed_queue_free(p_tcb->sr_cmd.multi_rsp_q, NULL); in gatt_cleanup_upon_disc()
1273 p_tcb->sr_cmd.multi_rsp_q = NULL; in gatt_cleanup_upon_disc()
1278 uint16_t conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, p_reg->gatt_if); in gatt_cleanup_upon_disc()
1280 p_tcb->tcb_idx, p_reg->gatt_if, conn_id); in gatt_cleanup_upon_disc()
1286 *p_tcb = tGATT_TCB(); in gatt_cleanup_upon_disc()
1317 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE); in gatt_auto_connect_dev_remove() local
1318 if (p_tcb) gatt_update_app_use_link_flag(gatt_if, p_tcb, false, false); in gatt_auto_connect_dev_remove()