Lines Matching refs:p_clcb
62 static void gatt_cl_start_config_ccc(tGATT_PROFILE_CLCB* p_clcb);
104 tGATT_PROFILE_CLCB* p_clcb = NULL; in gatt_profile_find_clcb_by_conn_id() local
106 for (i_clcb = 0, p_clcb = gatt_cb.profile_clcb; i_clcb < GATT_MAX_APPS; in gatt_profile_find_clcb_by_conn_id()
107 i_clcb++, p_clcb++) { in gatt_profile_find_clcb_by_conn_id()
108 if (p_clcb->in_use && p_clcb->conn_id == conn_id) return p_clcb; in gatt_profile_find_clcb_by_conn_id()
126 tGATT_PROFILE_CLCB* p_clcb = NULL; in gatt_profile_find_clcb_by_bd_addr() local
128 for (i_clcb = 0, p_clcb = gatt_cb.profile_clcb; i_clcb < GATT_MAX_APPS; in gatt_profile_find_clcb_by_bd_addr()
129 i_clcb++, p_clcb++) { in gatt_profile_find_clcb_by_bd_addr()
130 if (p_clcb->in_use && p_clcb->transport == transport && p_clcb->connected && in gatt_profile_find_clcb_by_bd_addr()
131 p_clcb->bda == bda) in gatt_profile_find_clcb_by_bd_addr()
132 return p_clcb; in gatt_profile_find_clcb_by_bd_addr()
153 tGATT_PROFILE_CLCB* p_clcb = NULL; in gatt_profile_clcb_alloc() local
155 for (i_clcb = 0, p_clcb = gatt_cb.profile_clcb; i_clcb < GATT_MAX_APPS; in gatt_profile_clcb_alloc()
156 i_clcb++, p_clcb++) { in gatt_profile_clcb_alloc()
157 if (!p_clcb->in_use) { in gatt_profile_clcb_alloc()
158 p_clcb->in_use = true; in gatt_profile_clcb_alloc()
159 p_clcb->conn_id = conn_id; in gatt_profile_clcb_alloc()
160 p_clcb->connected = true; in gatt_profile_clcb_alloc()
161 p_clcb->transport = tranport; in gatt_profile_clcb_alloc()
162 p_clcb->bda = bda; in gatt_profile_clcb_alloc()
166 if (i_clcb < GATT_MAX_APPS) return p_clcb; in gatt_profile_clcb_alloc()
181 void gatt_profile_clcb_dealloc(tGATT_PROFILE_CLCB* p_clcb) { in gatt_profile_clcb_dealloc() argument
182 memset(p_clcb, 0, sizeof(tGATT_PROFILE_CLCB)); in gatt_profile_clcb_dealloc()
248 tGATT_PROFILE_CLCB* p_clcb = in gatt_connect_cback() local
250 if (p_clcb == NULL) return; in gatt_connect_cback()
253 p_clcb->conn_id = conn_id; in gatt_connect_cback()
254 p_clcb->connected = true; in gatt_connect_cback()
256 if (p_clcb->ccc_stage == GATT_SVC_CHANGED_CONNECTING) { in gatt_connect_cback()
257 p_clcb->ccc_stage++; in gatt_connect_cback()
258 gatt_cl_start_config_ccc(p_clcb); in gatt_connect_cback()
261 gatt_profile_clcb_dealloc(p_clcb); in gatt_connect_cback()
314 tGATT_PROFILE_CLCB* p_clcb = gatt_profile_find_clcb_by_conn_id(conn_id); in gatt_disc_res_cback() local
316 if (p_clcb == NULL) return; in gatt_disc_res_cback()
320 p_clcb->e_handle = p_data->value.group_value.e_handle; in gatt_disc_res_cback()
321 p_clcb->ccc_result++; in gatt_disc_res_cback()
325 p_clcb->s_handle = p_data->value.dclr_value.val_handle; in gatt_disc_res_cback()
326 p_clcb->ccc_result++; in gatt_disc_res_cback()
331 p_clcb->s_handle = p_data->handle; in gatt_disc_res_cback()
332 p_clcb->ccc_result++; in gatt_disc_res_cback()
349 tGATT_PROFILE_CLCB* p_clcb = gatt_profile_find_clcb_by_conn_id(conn_id); in gatt_disc_cmpl_cback() local
351 if (p_clcb == NULL) return; in gatt_disc_cmpl_cback()
353 if (status != GATT_SUCCESS || p_clcb->ccc_result == 0) { in gatt_disc_cmpl_cback()
359 p_clcb->ccc_result = 0; in gatt_disc_cmpl_cback()
360 p_clcb->ccc_stage++; in gatt_disc_cmpl_cback()
361 gatt_cl_start_config_ccc(p_clcb); in gatt_disc_cmpl_cback()
387 static void gatt_cl_start_config_ccc(tGATT_PROFILE_CLCB* p_clcb) { in gatt_cl_start_config_ccc() argument
389 VLOG(1) << __func__ << ": stage: " << +p_clcb->ccc_stage; in gatt_cl_start_config_ccc()
391 switch (p_clcb->ccc_stage) { in gatt_cl_start_config_ccc()
393 GATTC_Discover(p_clcb->conn_id, GATT_DISC_SRVC_BY_UUID, 0x0001, 0xffff, in gatt_cl_start_config_ccc()
398 GATTC_Discover(p_clcb->conn_id, GATT_DISC_CHAR, 0x0001, p_clcb->e_handle, in gatt_cl_start_config_ccc()
403 GATTC_Discover(p_clcb->conn_id, GATT_DISC_CHAR_DSCPT, p_clcb->s_handle, in gatt_cl_start_config_ccc()
404 p_clcb->e_handle); in gatt_cl_start_config_ccc()
411 ccc_value.handle = p_clcb->s_handle; in gatt_cl_start_config_ccc()
414 GATTC_Write(p_clcb->conn_id, GATT_WRITE, &ccc_value); in gatt_cl_start_config_ccc()
431 tGATT_PROFILE_CLCB* p_clcb = in GATT_ConfigServiceChangeCCC() local
434 if (p_clcb == NULL) in GATT_ConfigServiceChangeCCC()
435 p_clcb = gatt_profile_clcb_alloc(0, remote_bda, transport); in GATT_ConfigServiceChangeCCC()
437 if (p_clcb == NULL) return; in GATT_ConfigServiceChangeCCC()
439 if (GATT_GetConnIdIfConnected(gatt_cb.gatt_if, remote_bda, &p_clcb->conn_id, in GATT_ConfigServiceChangeCCC()
441 p_clcb->connected = true; in GATT_ConfigServiceChangeCCC()
445 p_clcb->ccc_stage = GATT_SVC_CHANGED_CONNECTING; in GATT_ConfigServiceChangeCCC()
447 if (!p_clcb->connected) { in GATT_ConfigServiceChangeCCC()
452 p_clcb->ccc_stage++; in GATT_ConfigServiceChangeCCC()
453 gatt_cl_start_config_ccc(p_clcb); in GATT_ConfigServiceChangeCCC()