Home | History | Annotate | Download | only in gatt

Lines Matching refs:p_tcb

92 void gatt_free_pending_ind(tGATT_TCB *p_tcb)
96 while (!GKI_queue_is_empty(&p_tcb->pending_ind_q))
97 GKI_freebuf (GKI_dequeue (&p_tcb->pending_ind_q));
109 void gatt_free_pending_enc_queue(tGATT_TCB *p_tcb)
113 while (!GKI_queue_is_empty(&p_tcb->pending_enc_clcb))
114 GKI_freebuf (GKI_dequeue (&p_tcb->pending_enc_clcb));
215 tGATT_VALUE *gatt_add_pending_ind(tGATT_TCB *p_tcb, tGATT_VALUE *p_ind)
223 GKI_enqueue (&p_tcb->pending_ind_q, p_buf);
744 BOOLEAN gatt_is_srv_chg_ind_pending (tGATT_TCB *p_tcb)
746 tGATT_VALUE *p_buf = (tGATT_VALUE *)GKI_getfirst(&p_tcb->pending_ind_q);
749 GATT_TRACE_DEBUG("gatt_is_srv_chg_ind_pending is_queue_empty=%d", GKI_queue_is_empty(&p_tcb->pending_ind_q) );
751 if (p_tcb->indicate_handle == gatt_cb.handle_of_h_r)
865 tGATT_TCB *p_tcb = NULL;
868 p_tcb = &gatt_cb.tcb[tcb_idx];
870 return p_tcb;
884 tGATT_TCB *p_tcb = NULL;
888 p_tcb = &gatt_cb.tcb[i];
890 return p_tcb;
928 tGATT_TCB *p_tcb = NULL;
940 p_tcb = &gatt_cb.tcb[i];
944 memset(p_tcb, 0, sizeof(tGATT_TCB));
945 GKI_init_q (&p_tcb->pending_enc_clcb);
946 GKI_init_q (&p_tcb->pending_ind_q);
947 p_tcb->in_use = TRUE;
948 p_tcb->tcb_idx = i;
949 p_tcb->transport = transport;
951 memcpy(p_tcb->peer_bda, bda, BD_ADDR_LEN);
953 return p_tcb;
1194 void gatt_start_conf_timer(tGATT_TCB *p_tcb)
1196 p_tcb->conf_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb;
1197 btu_start_timer (&p_tcb->conf_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_RSP,
1209 void gatt_start_ind_ack_timer(tGATT_TCB *p_tcb)
1211 p_tcb->ind_ack_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb;
1213 btu_start_timer (&p_tcb->ind_ack_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_IND_ACK,
1229 if (p_clcb == NULL || p_clcb->p_tcb == NULL)
1240 if (p_clcb != gatt_cmd_dequeue(p_clcb->p_tcb, &rsp_code))
1253 gatt_disconnect (p_clcb->p_tcb);
1267 tGATT_TCB * p_tcb = (tGATT_TCB *)p_tle->param;
1271 if (p_tcb != NULL)
1272 p_tcb->ind_count = 0;
1438 tGATT_STATUS gatt_send_error_rsp (tGATT_TCB *p_tcb, UINT8 err_code, UINT8 op_code,
1449 if ((p_buf = attp_build_sr_msg(p_tcb, GATT_RSP_ERROR, (tGATT_SR_MSG *)&error)) != NULL)
1451 status = attp_send_sr_msg (p_tcb, p_buf);
1457 gatt_dequeue_sr_cmd(p_tcb);
1624 tGATT_TCB *p_tcb = gatt_get_tcb_by_idx(tcb_idx);
1637 p_clcb->p_tcb = p_tcb;
1676 tGATT_TCB *p_tcb = NULL;
1682 p_tcb = &gatt_cb.tcb[xx];
1686 return p_tcb;
1699 UINT8 gatt_num_apps_hold_link(tGATT_TCB *p_tcb)
1705 if (p_tcb->app_hold_link[i])
1729 if (gatt_cb.clcb[i].in_use && memcmp(gatt_cb.clcb[i].p_tcb->peer_bda, bda, BD_ADDR_LEN) == 0)
1744 void gatt_sr_copy_prep_cnt_to_cback_cnt(tGATT_TCB *p_tcb )
1748 if (p_tcb)
1752 if (p_tcb->prep_cnt[i])
1754 p_tcb->sr_cmd.cback_cnt[i]=1;
1770 BOOLEAN gatt_sr_is_cback_cnt_zero(tGATT_TCB *p_tcb )
1775 if (p_tcb)
1779 if (p_tcb->sr_cmd.cback_cnt[i])
1802 BOOLEAN gatt_sr_is_prep_cnt_zero(tGATT_TCB *p_tcb)
1807 if (p_tcb)
1811 if (p_tcb->prep_cnt[i])
1835 void gatt_sr_reset_cback_cnt(tGATT_TCB *p_tcb )
1839 if (p_tcb)
1843 p_tcb->sr_cmd.cback_cnt[i]=0;
1857 void gatt_sr_reset_prep_cnt(tGATT_TCB *p_tcb )
1860 if (p_tcb)
1864 p_tcb->prep_cnt[i]=0;
1879 void gatt_sr_update_cback_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc, BOOLEAN is_reset_first)
1884 if (p_tcb)
1888 gatt_sr_reset_cback_cnt(p_tcb);
1892 p_tcb->sr_cmd.cback_cnt[idx]++;
1896 if ( p_tcb->sr_cmd.cback_cnt[idx])
1898 p_tcb->sr_cmd.cback_cnt[idx]--;
1914 void gatt_sr_update_prep_cnt(tGATT_TCB *p_tcb, tGATT_IF gatt_if, BOOLEAN is_inc, BOOLEAN is_reset_first)
1919 p_tcb->tcb_idx, gatt_if, is_inc, is_reset_first);
1921 if (p_tcb)
1925 gatt_sr_reset_prep_cnt(p_tcb);
1929 p_tcb->prep_cnt[idx]++;
1933 if (p_tcb->prep_cnt[idx])
1935 p_tcb->prep_cnt[idx]--;
1951 tGATT_TCB *p_tcb=NULL;
1954 p_tcb = gatt_find_tcb_by_addr(bda, BT_TRANSPORT_LE);
1956 if (p_tcb)
1958 if (gatt_get_ch_state(p_tcb) == GATT_CH_OPEN)
1965 gatt_update_app_use_link_flag(gatt_if, p_tcb, FALSE, FALSE);
1966 if (!gatt_num_apps_hold_link(p_tcb))
1968 gatt_disconnect(p_tcb);
1985 BOOLEAN gatt_find_app_hold_link(tGATT_TCB *p_tcb, UINT8 start_idx, UINT8 *p_found_idx, tGATT_IF *p_gatt_if)
1992 if (p_tcb->app_hold_link[i])
2012 BOOLEAN gatt_cmd_enq(tGATT_TCB *p_tcb, UINT16 clcb_idx, BOOLEAN to_send, UINT8 op_code, BT_HDR *p_buf)
2014 tGATT_CMD_Q *p_cmd = &p_tcb->cl_cmd_q[p_tcb->next_slot_inq];
2023 p_tcb->pending_cl_req = p_tcb->next_slot_inq;
2026 p_tcb->next_slot_inq ++;
2027 p_tcb->next_slot_inq %= GATT_CL_MAX_LCB;
2041 tGATT_CLCB * gatt_cmd_dequeue(tGATT_TCB *p_tcb, UINT8 *p_op_code)
2043 tGATT_CMD_Q *p_cmd = &p_tcb->cl_cmd_q[p_tcb->pending_cl_req];
2046 if (p_tcb->pending_cl_req != p_tcb->next_slot_inq)
2052 p_tcb->pending_cl_req ++;
2053 p_tcb->pending_cl_req %= GATT_CL_MAX_LCB;
2068 UINT8 gatt_send_write_msg (tGATT_TCB *p_tcb, UINT16 clcb_idx, UINT8 op_code,
2081 return attp_send_cl_msg(p_tcb, clcb_idx, op_code, &msg);
2094 UINT8 gatt_act_send_browse(tGATT_TCB *p_tcb, UINT16 index, UINT8 op, UINT16 s_handle,
2104 return attp_send_cl_msg(p_tcb, index, op, &msg);
2160 cb_data.mtu = p_clcb->p_tcb->payload_size;
2200 tGATT_TCB *p_tcb = NULL;
2209 if ((p_tcb = gatt_find_tcb_by_addr(bda, transport)) != NULL)
2211 GATT_TRACE_DEBUG ("found p_tcb ");
2212 gatt_set_ch_state(p_tcb, GATT_CH_CLOSE);
2216 if (p_clcb->in_use && p_clcb->p_tcb == p_tcb)
2228 btu_stop_timer (&p_tcb->ind_ack_timer_ent);
2229 btu_stop_timer (&p_tcb->conf_timer_ent);
2230 gatt_free_pending_ind(p_tcb);
2231 gatt_free_pending_enc_queue(p_tcb);
2238 conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, p_reg->gatt_if);
2239 GATT_TRACE_DEBUG ("found p_reg tcb_idx=%d gatt_if=%d conn_id=0x%x", p_tcb->tcb_idx, p_reg->gatt_if, conn_id);
2243 memset(p_tcb, 0, sizeof(tGATT_TCB));
2478 tGATT_TCB *p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE);
2481 if (p_tcb)
2482 gatt_update_app_use_link_flag(gatt_if, p_tcb, FALSE, FALSE);
2700 tGATT_TCB *p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE);
2714 if (ret && p_tcb != NULL)
2717 gatt_update_app_use_link_flag(gatt_if, p_tcb, TRUE, TRUE);
2738 tGATT_PENDING_ENC_CLCB* gatt_add_pending_enc_channel_clcb(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb )
2747 GKI_enqueue (&p_tcb->pending_enc_clcb, p_buf);