Lines Matching refs:p_tcb
416 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATTS_HandleValueIndication() local
419 if ((p_reg == NULL) || (p_tcb == NULL)) { in GATTS_HandleValueIndication()
433 if (GATT_HANDLE_IS_VALID(p_tcb->indicate_handle)) { in GATTS_HandleValueIndication()
435 gatt_add_pending_ind(p_tcb, &indication); in GATTS_HandleValueIndication()
442 attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_IND, &gatt_sr_msg); in GATTS_HandleValueIndication()
445 tGATT_STATUS cmd_status = attp_send_sr_msg(*p_tcb, p_msg); in GATTS_HandleValueIndication()
447 p_tcb->indicate_handle = indication.handle; in GATTS_HandleValueIndication()
448 gatt_start_conf_timer(p_tcb); in GATTS_HandleValueIndication()
475 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATTS_HandleValueNotification() local
479 if ((p_reg == NULL) || (p_tcb == NULL)) { in GATTS_HandleValueNotification()
497 attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_NOTIF, &gatt_sr_msg); in GATTS_HandleValueNotification()
499 cmd_sent = attp_send_sr_msg(*p_tcb, p_buf); in GATTS_HandleValueNotification()
525 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATTS_SendRsp() local
530 if ((p_reg == NULL) || (p_tcb == NULL)) { in GATTS_SendRsp()
535 if (p_tcb->sr_cmd.trans_id != trans_id) { in GATTS_SendRsp()
537 << " waiting for op_code=" << loghex(p_tcb->sr_cmd.op_code); in GATTS_SendRsp()
541 cmd_sent = gatt_sr_process_app_rsp(*p_tcb, gatt_if, trans_id, in GATTS_SendRsp()
542 p_tcb->sr_cmd.op_code, status, p_msg); in GATTS_SendRsp()
572 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATTC_ConfigureMTU() local
577 if ((p_tcb == NULL) || (p_reg == NULL) || (mtu < GATT_DEF_BLE_MTU_SIZE) || in GATTC_ConfigureMTU()
583 if (p_tcb->transport != BT_TRANSPORT_LE) { in GATTC_ConfigureMTU()
595 p_clcb->p_tcb->payload_size = mtu; in GATTC_ConfigureMTU()
599 return attp_send_cl_msg(*p_clcb->p_tcb, p_clcb, GATT_REQ_MTU, &gatt_cl_msg); in GATTC_ConfigureMTU()
623 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATTC_Discover() local
626 if ((p_tcb == NULL) || (p_reg == NULL) || (disc_type >= GATT_DISC_MAX)) { in GATTC_Discover()
686 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATTC_Read() local
692 if ((p_tcb == NULL) || (p_reg == NULL) || (p_read == NULL) || in GATTC_Read()
711 p_clcb->read_req_current_mtu = p_tcb->payload_size; in GATTC_Read()
744 if (gatt_security_check_start(p_clcb)) p_tcb->pending_enc_clcb.push(p_clcb); in GATTC_Read()
766 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATTC_Write() local
769 if ((p_tcb == NULL) || (p_reg == NULL) || (p_write == NULL) || in GATTC_Write()
798 if (gatt_security_check_start(p_clcb)) p_tcb->pending_enc_clcb.push(p_clcb); in GATTC_Write()
819 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATTC_ExecuteWrite() local
825 if ((p_tcb == NULL) || (p_reg == NULL)) { in GATTC_ExecuteWrite()
841 gatt_send_queue_write_cancel(*p_clcb->p_tcb, p_clcb, flag); in GATTC_ExecuteWrite()
862 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(GATT_GET_TCB_IDX(conn_id)); in GATTC_SendHandleValueConfirm() local
863 if (!p_tcb) { in GATTC_SendHandleValueConfirm()
868 if (p_tcb->ind_count == 0) { in GATTC_SendHandleValueConfirm()
874 alarm_cancel(p_tcb->ind_ack_timer); in GATTC_SendHandleValueConfirm()
876 VLOG(1) << "notif_count= " << p_tcb->ind_count; in GATTC_SendHandleValueConfirm()
881 attp_send_cl_msg(*p_tcb, nullptr, GATT_HANDLE_VALUE_CONF, &gatt_cl_msg); in GATTC_SendHandleValueConfirm()
883 p_tcb->ind_count = 0; in GATTC_SendHandleValueConfirm()
910 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, transport); in GATT_SetIdleTimeout() local
911 if (p_tcb != NULL) { in GATT_SetIdleTimeout()
912 if (p_tcb->att_lcid == L2CAP_ATT_CID) { in GATT_SetIdleTimeout()
916 L2CA_SetIdleTimeoutByBdAddr(p_tcb->peer_bda, in GATT_SetIdleTimeout()
920 status = L2CA_SetIdleTimeout(p_tcb->att_lcid, idle_tout, false); in GATT_SetIdleTimeout()
1017 tGATT_TCB* p_tcb; in GATT_Deregister() local
1019 for (i = 0, p_tcb = gatt_cb.tcb; i < GATT_MAX_PHY_CHANNEL; i++, p_tcb++) { in GATT_Deregister()
1020 if (!p_tcb->in_use) continue; in GATT_Deregister()
1022 if (gatt_get_ch_state(p_tcb) != GATT_CH_CLOSE) { in GATT_Deregister()
1023 gatt_update_app_use_link_flag(gatt_if, p_tcb, false, true); in GATT_Deregister()
1029 (p_clcb->p_tcb->tcb_idx == p_tcb->tcb_idx)) { in GATT_Deregister()
1057 tGATT_TCB* p_tcb; in GATT_StartIf() local
1069 p_tcb = gatt_find_tcb_by_addr(bda, transport); in GATT_StartIf()
1070 if (p_reg->app_cb.p_conn_cb && p_tcb) { in GATT_StartIf()
1071 conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, gatt_if); in GATT_StartIf()
1139 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, transport); in GATT_Connect() local
1141 if (p_tcb && ret) in GATT_Connect()
1142 gatt_update_app_use_link_flag(p_reg->gatt_if, p_tcb, true, !is_direct); in GATT_Connect()
1184 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, BT_TRANSPORT_LE); in GATT_CancelConnect() local
1185 if (p_tcb && !p_tcb->app_hold_link.empty()) { in GATT_CancelConnect()
1186 for (auto it = p_tcb->app_hold_link.begin(); in GATT_CancelConnect()
1187 it != p_tcb->app_hold_link.end();) { in GATT_CancelConnect()
1222 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATT_Disconnect() local
1223 if (!p_tcb) return GATT_ILLEGAL_PARAMETER; in GATT_Disconnect()
1226 gatt_update_app_use_link_flag(gatt_if, p_tcb, false, true); in GATT_Disconnect()
1249 tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); in GATT_GetConnectionInfor() local
1253 if (!p_tcb || !p_reg) return false; in GATT_GetConnectionInfor()
1255 bd_addr = p_tcb->peer_bda; in GATT_GetConnectionInfor()
1257 *p_transport = p_tcb->transport; in GATT_GetConnectionInfor()
1279 tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(bd_addr, transport); in GATT_GetConnIdIfConnected() local
1282 if (p_reg && p_tcb && (gatt_get_ch_state(p_tcb) == GATT_CH_OPEN)) { in GATT_GetConnIdIfConnected()
1283 *p_conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, gatt_if); in GATT_GetConnIdIfConnected()