Lines Matching refs:tcb

63 void gatt_send_prepare_write(tGATT_TCB& tcb, tGATT_CLCB* p_clcb);
152 tGATT_TCB& tcb = *p_clcb->p_tcb; in gatt_act_read() local
219 if (op_code != 0) rt = attp_send_cl_msg(tcb, p_clcb, op_code, &msg); in gatt_act_read()
228 tGATT_TCB& tcb = *p_clcb->p_tcb; in gatt_act_write() local
234 uint16_t payload_size = gatt_tcb_get_payload_size(tcb, p_clcb->cid); in gatt_act_write()
241 tGATT_STATUS rt = gatt_send_write_msg(tcb, p_clcb, op_code, attr.handle, in gatt_act_write()
258 tcb, p_clcb, GATT_REQ_WRITE, attr.handle, attr.len, 0, attr.value); in gatt_act_write()
270 gatt_send_prepare_write(tcb, p_clcb); in gatt_act_write()
276 gatt_send_prepare_write(tcb, p_clcb); in gatt_act_write()
293 void gatt_send_queue_write_cancel(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, in gatt_send_queue_write_cancel() argument
301 rt = attp_send_cl_msg(tcb, p_clcb, GATT_REQ_EXEC_WRITE, &gatt_cl_msg); in gatt_send_queue_write_cancel()
316 bool gatt_check_write_long_terminate(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, in gatt_check_write_long_terminate() argument
341 gatt_send_queue_write_cancel(tcb, p_clcb, flag); in gatt_check_write_long_terminate()
347 void gatt_send_prepare_write(tGATT_TCB& tcb, tGATT_CLCB* p_clcb) { in gatt_send_prepare_write() argument
354 uint16_t payload_size = gatt_tcb_get_payload_size(tcb, p_clcb->cid); in gatt_send_prepare_write()
369 tcb, p_clcb, GATT_REQ_PREPARE_WRITE, p_attr->handle, to_send, /* length */ in gatt_send_prepare_write()
526 void gatt_process_error_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, in gatt_process_error_rsp() argument
554 gatt_proc_disc_error_rsp(tcb, p_clcb, opcode, handle, in gatt_process_error_rsp()
562 gatt_send_queue_write_cancel(tcb, p_clcb, GATT_PREP_WRITE_CANCEL); in gatt_process_error_rsp()
584 void gatt_process_prep_write_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, in gatt_process_prep_write_rsp() argument
612 if (!gatt_check_write_long_terminate(tcb, p_clcb, &value)) { in gatt_process_prep_write_rsp()
613 gatt_send_prepare_write(tcb, p_clcb); in gatt_process_prep_write_rsp()
636 void gatt_process_notification(tGATT_TCB& tcb, uint16_t cid, uint8_t op_code, in gatt_process_notification() argument
663 attp_send_cl_confirmation_msg(tcb, cid); in gatt_process_notification()
696 if (tcb.ind_count) { in gatt_process_notification()
703 tcb.ind_count); in gatt_process_notification()
707 tcb.ind_count = 0; in gatt_process_notification()
714 if (p_reg->in_use && p_reg->app_cb.p_cmpl_cb) tcb.ind_count++; in gatt_process_notification()
718 if (tcb.ind_count > 0) { in gatt_process_notification()
719 gatt_start_ind_ack_timer(tcb, cid); in gatt_process_notification()
721 attp_send_cl_confirmation_msg(tcb, cid); in gatt_process_notification()
725 encrypt_status = gatt_get_link_encrypt_status(tcb); in gatt_process_notification()
735 conn_id = GATT_CREATE_CONN_ID(tcb.tcb_idx, p_reg->gatt_if); in gatt_process_notification()
775 conn_id = GATT_CREATE_CONN_ID(tcb.tcb_idx, p_reg->gatt_if); in gatt_process_notification()
794 void gatt_process_read_by_type_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, in gatt_process_read_by_type_rsp() argument
814 uint16_t payload_size = gatt_tcb_get_payload_size(tcb, p_clcb->cid); in gatt_process_read_by_type_rsp()
995 void gatt_process_read_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, in gatt_process_read_rsp() argument
1001 uint16_t payload_size = gatt_tcb_get_payload_size(tcb, p_clcb->cid); in gatt_process_read_rsp()
1094 void gatt_process_mtu_rsp(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, uint16_t len, in gatt_process_mtu_rsp() argument
1106 tcb.pending_user_mtu_exchange_value, tcb.peer_bda, mtu); in gatt_process_mtu_rsp()
1110 tcb.payload_size = GATT_DEF_BLE_MTU_SIZE; in gatt_process_mtu_rsp()
1112 tcb.payload_size = std::min(mtu, (uint16_t)(gatt_get_local_mtu())); in gatt_process_mtu_rsp()
1115 bluetooth::shim::arbiter::GetArbiter().OnIncomingMtuResp(tcb.tcb_idx, in gatt_process_mtu_rsp()
1116 tcb.payload_size); in gatt_process_mtu_rsp()
1120 if (tcb.pending_user_mtu_exchange_value > tcb.max_user_mtu) { in gatt_process_mtu_rsp()
1121 tcb.max_user_mtu = in gatt_process_mtu_rsp()
1122 std::min(tcb.pending_user_mtu_exchange_value, tcb.payload_size); in gatt_process_mtu_rsp()
1123 } else if (tcb.pending_user_mtu_exchange_value == 0) { in gatt_process_mtu_rsp()
1124 tcb.max_user_mtu = tcb.payload_size; in gatt_process_mtu_rsp()
1126 tcb.pending_user_mtu_exchange_value = 0; in gatt_process_mtu_rsp()
1128 log::info("MTU Exchange resulted in: {}", tcb.payload_size); in gatt_process_mtu_rsp()
1130 BTM_SetBleDataLength(tcb.peer_bda, tcb.max_user_mtu + L2CAP_PKT_OVERHEAD); in gatt_process_mtu_rsp()
1155 bool gatt_cl_send_next_cmd_inq(tGATT_TCB& tcb) { in gatt_cl_send_next_cmd_inq() argument
1159 gatt_is_outstanding_msg_in_att_send_queue(tcb) || in gatt_cl_send_next_cmd_inq()
1160 EattExtension::GetInstance()->IsOutstandingMsgInSendQueue(tcb.peer_bda)) { in gatt_cl_send_next_cmd_inq()
1161 if (gatt_is_outstanding_msg_in_att_send_queue(tcb)) { in gatt_cl_send_next_cmd_inq()
1162 cl_cmd_q = &tcb.cl_cmd_q; in gatt_cl_send_next_cmd_inq()
1166 tcb.peer_bda); in gatt_cl_send_next_cmd_inq()
1176 att_ret = attp_send_msg_to_l2cap(tcb, cmd.cid, cmd.p_cmd); in gatt_cl_send_next_cmd_inq()
1190 tGATT_CLCB* p_clcb = gatt_cmd_dequeue(tcb, cmd.cid, &rsp_code); in gatt_cl_send_next_cmd_inq()
1209 void gatt_client_handle_server_rsp(tGATT_TCB& tcb, uint16_t cid, in gatt_client_handle_server_rsp() argument
1214 uint16_t payload_size = gatt_tcb_get_payload_size(tcb, cid); in gatt_client_handle_server_rsp()
1224 gatt_process_notification(tcb, cid, op_code, len, p_data); in gatt_client_handle_server_rsp()
1229 tGATT_CLCB* p_clcb = gatt_cmd_dequeue(tcb, cid, &cmd_code); in gatt_client_handle_server_rsp()
1232 gatt_cl_send_next_cmd_inq(tcb); in gatt_client_handle_server_rsp()
1239 gatt_cl_send_next_cmd_inq(tcb); in gatt_client_handle_server_rsp()
1264 gatt_process_error_rsp(tcb, p_clcb, op_code, len, p_data); in gatt_client_handle_server_rsp()
1268 gatt_process_mtu_rsp(tcb, p_clcb, len, p_data); in gatt_client_handle_server_rsp()
1272 gatt_process_read_info_rsp(tcb, p_clcb, op_code, len, p_data); in gatt_client_handle_server_rsp()
1277 gatt_process_read_by_type_rsp(tcb, p_clcb, op_code, len, p_data); in gatt_client_handle_server_rsp()
1284 gatt_process_read_rsp(tcb, p_clcb, op_code, len, p_data); in gatt_client_handle_server_rsp()
1288 gatt_process_find_type_value_rsp(tcb, p_clcb, len, p_data); in gatt_client_handle_server_rsp()
1296 gatt_process_prep_write_rsp(tcb, p_clcb, op_code, len, p_data); in gatt_client_handle_server_rsp()
1309 gatt_cl_send_next_cmd_inq(tcb); in gatt_client_handle_server_rsp()