Lines Matching refs:p_clcb

263   tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_alloc_clcb(  in bta_gattc_process_api_open()  local
266 if (p_clcb != NULL) { in bta_gattc_process_api_open()
267 bta_gattc_sm_execute(p_clcb, event, p_msg); in bta_gattc_process_api_open()
290 tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_clcb_by_cif( in bta_gattc_process_api_open_cancel() local
293 if (p_clcb != NULL) { in bta_gattc_process_api_open_cancel()
294 bta_gattc_sm_execute(p_clcb, event, p_msg); in bta_gattc_process_api_open_cancel()
325 void bta_gattc_cancel_open_error(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_cancel_open_error() argument
331 if (p_clcb && p_clcb->p_rcb && p_clcb->p_rcb->p_cback) in bta_gattc_cancel_open_error()
332 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_CANCEL_OPEN_EVT, &cb_data); in bta_gattc_cancel_open_error()
335 void bta_gattc_open_error(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_open_error() argument
339 bta_gattc_send_open_cback(p_clcb->p_rcb, GATT_SUCCESS, p_clcb->bda, in bta_gattc_open_error()
340 p_clcb->bta_conn_id, p_clcb->transport, 0); in bta_gattc_open_error()
343 void bta_gattc_open_fail(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_open_fail() argument
346 << loghex(p_clcb->bta_conn_id) << ". Return GATT_ERROR(" in bta_gattc_open_fail()
349 bta_gattc_send_open_cback(p_clcb->p_rcb, GATT_ERROR, p_clcb->bda, in bta_gattc_open_fail()
350 p_clcb->bta_conn_id, p_clcb->transport, 0); in bta_gattc_open_fail()
352 bta_gattc_clcb_dealloc(p_clcb); in bta_gattc_open_fail()
356 void bta_gattc_open(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_open() argument
360 if (!GATT_Connect(p_clcb->p_rcb->client_if, p_data->api_conn.remote_bda, true, in bta_gattc_open()
365 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_OPEN_FAIL_EVT, p_data); in bta_gattc_open()
371 p_clcb->p_rcb->client_if, p_data->api_conn.remote_bda, in bta_gattc_open()
372 &p_clcb->bta_conn_id, p_data->api_conn.transport)) { in bta_gattc_open()
373 gattc_data.int_conn.hdr.layer_specific = p_clcb->bta_conn_id; in bta_gattc_open()
375 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_CONN_EVT, &gattc_data); in bta_gattc_open()
406 tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_alloc_clcb( in bta_gattc_init_bk_conn() local
408 if (!p_clcb) return; in bta_gattc_init_bk_conn()
411 gattc_data.hdr.layer_specific = p_clcb->bta_conn_id = conn_id; in bta_gattc_init_bk_conn()
414 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_CONN_EVT, in bta_gattc_init_bk_conn()
439 void bta_gattc_cancel_open_ok(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_cancel_open_ok() argument
443 if (p_clcb->p_rcb->p_cback) { in bta_gattc_cancel_open_ok()
445 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_CANCEL_OPEN_EVT, &cb_data); in bta_gattc_cancel_open_ok()
448 bta_gattc_clcb_dealloc(p_clcb); in bta_gattc_cancel_open_ok()
451 void bta_gattc_cancel_open(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_cancel_open() argument
455 if (GATT_CancelConnect(p_clcb->p_rcb->client_if, in bta_gattc_cancel_open()
457 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_CANCEL_OPEN_OK_EVT, p_data); in bta_gattc_cancel_open()
459 if (p_clcb->p_rcb->p_cback) { in bta_gattc_cancel_open()
461 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_CANCEL_OPEN_EVT, &cb_data); in bta_gattc_cancel_open()
467 void bta_gattc_conn(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_conn() argument
469 VLOG(1) << __func__ << ": server cache state=" << +p_clcb->p_srcb->state; in bta_gattc_conn()
473 p_clcb->bta_conn_id = p_data->int_conn.hdr.layer_specific; in bta_gattc_conn()
475 GATT_GetConnectionInfor(p_data->hdr.layer_specific, &gatt_if, p_clcb->bda, in bta_gattc_conn()
476 &p_clcb->transport); in bta_gattc_conn()
479 p_clcb->p_srcb->connected = true; in bta_gattc_conn()
481 if (p_clcb->p_srcb->mtu == 0) p_clcb->p_srcb->mtu = GATT_DEF_BLE_MTU_SIZE; in bta_gattc_conn()
484 if (p_clcb->p_srcb->gatt_database.IsEmpty() || in bta_gattc_conn()
485 p_clcb->p_srcb->state != BTA_GATTC_SERV_IDLE) { in bta_gattc_conn()
486 if (p_clcb->p_srcb->state == BTA_GATTC_SERV_IDLE) { in bta_gattc_conn()
487 p_clcb->p_srcb->state = BTA_GATTC_SERV_LOAD; in bta_gattc_conn()
488 if (bta_gattc_cache_load(p_clcb->p_srcb)) { in bta_gattc_conn()
489 p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE; in bta_gattc_conn()
490 bta_gattc_reset_discover_st(p_clcb->p_srcb, GATT_SUCCESS); in bta_gattc_conn()
492 p_clcb->p_srcb->state = BTA_GATTC_SERV_DISC; in bta_gattc_conn()
494 bta_gattc_start_discover(p_clcb, NULL); in bta_gattc_conn()
497 p_clcb->state = BTA_GATTC_DISCOVER_ST; in bta_gattc_conn()
502 if (p_clcb->p_srcb->srvc_hdl_chg) { in bta_gattc_conn()
503 p_clcb->p_srcb->srvc_hdl_chg = false; in bta_gattc_conn()
507 p_clcb->p_srcb->srvc_hdl_db_hash = true; in bta_gattc_conn()
511 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_DISCOVER_EVT, NULL); in bta_gattc_conn()
515 if (p_clcb->p_rcb) { in bta_gattc_conn()
517 if (p_clcb->transport == BT_TRANSPORT_BR_EDR) in bta_gattc_conn()
518 bta_sys_conn_open(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); in bta_gattc_conn()
520 bta_gattc_send_open_cback(p_clcb->p_rcb, GATT_SUCCESS, p_clcb->bda, in bta_gattc_conn()
521 p_clcb->bta_conn_id, p_clcb->transport, in bta_gattc_conn()
522 p_clcb->p_srcb->mtu); in bta_gattc_conn()
527 void bta_gattc_close_fail(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_close_fail() argument
531 if (p_clcb->p_rcb->p_cback) { in bta_gattc_close_fail()
533 cb_data.close.client_if = p_clcb->p_rcb->client_if; in bta_gattc_close_fail()
535 cb_data.close.remote_bda = p_clcb->bda; in bta_gattc_close_fail()
541 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_CLOSE_EVT, &cb_data); in bta_gattc_close_fail()
546 void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_close() argument
547 tBTA_GATTC_CBACK* p_cback = p_clcb->p_rcb->p_cback; in bta_gattc_close()
548 tBTA_GATTC_RCB* p_clreg = p_clcb->p_rcb; in bta_gattc_close()
552 .client_if = p_clcb->p_rcb->client_if, in bta_gattc_close()
553 .conn_id = p_clcb->bta_conn_id, in bta_gattc_close()
555 .remote_bda = p_clcb->bda, in bta_gattc_close()
560 if (p_clcb->transport == BT_TRANSPORT_BR_EDR) in bta_gattc_close()
561 bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); in bta_gattc_close()
563 bta_gattc_clcb_dealloc(p_clcb); in bta_gattc_close()
600 void bta_gattc_disc_close(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_disc_close() argument
603 << ": Discovery cancel conn_id=" << loghex(p_clcb->bta_conn_id); in bta_gattc_disc_close()
605 if (p_clcb->disc_active) in bta_gattc_disc_close()
606 bta_gattc_reset_discover_st(p_clcb->p_srcb, GATT_ERROR); in bta_gattc_disc_close()
608 p_clcb->state = BTA_GATTC_CONN_ST; in bta_gattc_disc_close()
613 if (p_clcb->state == BTA_GATTC_CONN_ST) { in bta_gattc_disc_close()
615 bta_gattc_close(p_clcb, p_data); in bta_gattc_disc_close()
636 void bta_gattc_restart_discover(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_restart_discover() argument
638 p_clcb->status = GATT_CANCEL; in bta_gattc_restart_discover()
639 p_clcb->auto_update = BTA_GATTC_DISC_WAITING; in bta_gattc_restart_discover()
643 void bta_gattc_cfg_mtu(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_cfg_mtu() argument
644 if (!bta_gattc_enqueue(p_clcb, p_data)) return; in bta_gattc_cfg_mtu()
647 GATTC_ConfigureMTU(p_clcb->bta_conn_id, p_data->api_mtu.mtu); in bta_gattc_cfg_mtu()
652 if (p_clcb->p_q_cmd == p_data) p_clcb->p_q_cmd = NULL; in bta_gattc_cfg_mtu()
654 bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_CONFIG, status, in bta_gattc_cfg_mtu()
659 void bta_gattc_start_discover_internal(tBTA_GATTC_CLCB* p_clcb) { in bta_gattc_start_discover_internal() argument
660 if (p_clcb->transport == BT_TRANSPORT_LE) in bta_gattc_start_discover_internal()
661 L2CA_EnableUpdateBleConnParams(p_clcb->p_srcb->server_bda, false); in bta_gattc_start_discover_internal()
663 bta_gattc_init_cache(p_clcb->p_srcb); in bta_gattc_start_discover_internal()
664 p_clcb->status = bta_gattc_discover_pri_service( in bta_gattc_start_discover_internal()
665 p_clcb->bta_conn_id, p_clcb->p_srcb, GATT_DISC_SRVC_ALL); in bta_gattc_start_discover_internal()
666 if (p_clcb->status != GATT_SUCCESS) { in bta_gattc_start_discover_internal()
668 bta_gattc_reset_discover_st(p_clcb->p_srcb, p_clcb->status); in bta_gattc_start_discover_internal()
670 p_clcb->disc_active = true; in bta_gattc_start_discover_internal()
674 void bta_gattc_start_discover(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_start_discover() argument
676 VLOG(1) << __func__ << ": conn_id:" << loghex(p_clcb->bta_conn_id) in bta_gattc_start_discover()
677 << " p_clcb->p_srcb->state:" << +p_clcb->p_srcb->state; in bta_gattc_start_discover()
679 if (((p_clcb->p_q_cmd == NULL || in bta_gattc_start_discover()
680 p_clcb->auto_update == BTA_GATTC_REQ_WAITING) && in bta_gattc_start_discover()
681 p_clcb->p_srcb->state == BTA_GATTC_SERV_IDLE) || in bta_gattc_start_discover()
682 p_clcb->p_srcb->state == BTA_GATTC_SERV_DISC) in bta_gattc_start_discover()
685 p_clcb->auto_update = BTA_GATTC_NO_SCHEDULE; in bta_gattc_start_discover()
687 if (p_clcb->p_srcb != NULL) { in bta_gattc_start_discover()
689 bta_gattc_set_discover_st(p_clcb->p_srcb); in bta_gattc_start_discover()
692 p_clcb->p_srcb->srvc_hdl_chg = false; in bta_gattc_start_discover()
693 p_clcb->p_srcb->update_count = 0; in bta_gattc_start_discover()
694 p_clcb->p_srcb->state = BTA_GATTC_SERV_DISC_ACT; in bta_gattc_start_discover()
698 p_clcb->p_srcb->srvc_hdl_db_hash && bta_gattc_read_db_hash(p_clcb)) { in bta_gattc_start_discover()
701 p_clcb->p_srcb->srvc_hdl_db_hash = false; in bta_gattc_start_discover()
705 bta_gattc_start_discover_internal(p_clcb); in bta_gattc_start_discover()
712 p_clcb->auto_update = BTA_GATTC_DISC_WAITING; in bta_gattc_start_discover()
714 if (p_clcb->p_srcb->state == BTA_GATTC_SERV_IDLE) in bta_gattc_start_discover()
715 p_clcb->state = BTA_GATTC_CONN_ST; /* set clcb state */ in bta_gattc_start_discover()
720 void bta_gattc_disc_cmpl(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_disc_cmpl() argument
722 const tBTA_GATTC_DATA* p_q_cmd = p_clcb->p_q_cmd; in bta_gattc_disc_cmpl()
724 VLOG(1) << __func__ << ": conn_id=" << loghex(p_clcb->bta_conn_id); in bta_gattc_disc_cmpl()
726 if (p_clcb->transport == BT_TRANSPORT_LE) in bta_gattc_disc_cmpl()
727 L2CA_EnableUpdateBleConnParams(p_clcb->p_srcb->server_bda, true); in bta_gattc_disc_cmpl()
728 p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE; in bta_gattc_disc_cmpl()
729 p_clcb->disc_active = false; in bta_gattc_disc_cmpl()
731 if (p_clcb->status != GATT_SUCCESS) { in bta_gattc_disc_cmpl()
733 if (p_clcb->p_srcb) { in bta_gattc_disc_cmpl()
734 p_clcb->p_srcb->gatt_database.Clear(); in bta_gattc_disc_cmpl()
738 bta_gattc_cache_reset(p_clcb->p_srcb->server_bda); in bta_gattc_disc_cmpl()
741 if (p_clcb->p_srcb) { in bta_gattc_disc_cmpl()
742 p_clcb->p_srcb->pending_discovery.Clear(); in bta_gattc_disc_cmpl()
745 if (p_clcb->auto_update == BTA_GATTC_DISC_WAITING) { in bta_gattc_disc_cmpl()
747 p_clcb->auto_update = BTA_GATTC_REQ_WAITING; in bta_gattc_disc_cmpl()
748 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_DISCOVER_EVT, NULL); in bta_gattc_disc_cmpl()
752 p_clcb->p_q_cmd = NULL; in bta_gattc_disc_cmpl()
754 if (L2CA_IsLinkEstablished(p_clcb->p_srcb->server_bda, p_clcb->transport)) { in bta_gattc_disc_cmpl()
755 bta_gattc_sm_execute(p_clcb, p_q_cmd->hdr.event, p_q_cmd); in bta_gattc_disc_cmpl()
761 if (p_q_cmd != p_clcb->p_q_cmd) osi_free_and_reset((void**)&p_q_cmd); in bta_gattc_disc_cmpl()
764 if (p_clcb->p_rcb->p_cback) { in bta_gattc_disc_cmpl()
766 bta_gattc.remote_bda = p_clcb->p_srcb->server_bda; in bta_gattc_disc_cmpl()
767 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_SRVC_DISC_DONE_EVT, &bta_gattc); in bta_gattc_disc_cmpl()
772 void bta_gattc_read(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_read() argument
773 if (!bta_gattc_enqueue(p_clcb, p_data)) return; in bta_gattc_read()
781 status = GATTC_Read(p_clcb->bta_conn_id, GATT_READ_BY_HANDLE, &read_param); in bta_gattc_read()
790 status = GATTC_Read(p_clcb->bta_conn_id, GATT_READ_BY_TYPE, &read_param); in bta_gattc_read()
796 if (p_clcb->p_q_cmd == p_data) p_clcb->p_q_cmd = NULL; in bta_gattc_read()
798 bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_READ, status, in bta_gattc_read()
804 void bta_gattc_read_multi(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_read_multi() argument
806 if (!bta_gattc_enqueue(p_clcb, p_data)) return; in bta_gattc_read_multi()
817 GATTC_Read(p_clcb->bta_conn_id, GATT_READ_MULTIPLE, &read_param); in bta_gattc_read_multi()
821 if (p_clcb->p_q_cmd == p_data) p_clcb->p_q_cmd = NULL; in bta_gattc_read_multi()
823 bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_READ, status, in bta_gattc_read_multi()
829 void bta_gattc_write(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_write() argument
830 if (!bta_gattc_enqueue(p_clcb, p_data)) return; in bta_gattc_write()
835 attr.conn_id = p_clcb->bta_conn_id; in bta_gattc_write()
845 GATTC_Write(p_clcb->bta_conn_id, p_data->api_write.write_type, &attr); in bta_gattc_write()
850 if (p_clcb->p_q_cmd == p_data) p_clcb->p_q_cmd = NULL; in bta_gattc_write()
852 bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_WRITE, status, in bta_gattc_write()
858 void bta_gattc_execute(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_execute() argument
859 if (!bta_gattc_enqueue(p_clcb, p_data)) return; in bta_gattc_execute()
862 GATTC_ExecuteWrite(p_clcb->bta_conn_id, p_data->api_exec.is_execute); in bta_gattc_execute()
865 if (p_clcb->p_q_cmd == p_data) p_clcb->p_q_cmd = NULL; in bta_gattc_execute()
867 bta_gattc_cmpl_sendmsg(p_clcb->bta_conn_id, GATTC_OPTYPE_EXE_WRITE, status, in bta_gattc_execute()
873 void bta_gattc_confirm(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_confirm() argument
881 if (p_clcb->transport == BT_TRANSPORT_BR_EDR) { in bta_gattc_confirm()
882 bta_sys_busy(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); in bta_gattc_confirm()
883 bta_sys_idle(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); in bta_gattc_confirm()
889 static void bta_gattc_read_cmpl(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_read_cmpl() argument
891 GATT_READ_OP_CB cb = p_clcb->p_q_cmd->api_read.read_cb; in bta_gattc_read_cmpl()
892 void* my_cb_data = p_clcb->p_q_cmd->api_read.read_cb_data; in bta_gattc_read_cmpl()
897 uint16_t handle = p_clcb->p_q_cmd->api_read.handle; in bta_gattc_read_cmpl()
900 osi_free_and_reset((void**)&p_clcb->p_q_cmd); in bta_gattc_read_cmpl()
903 cb(p_clcb->bta_conn_id, p_data->status, handle, in bta_gattc_read_cmpl()
910 static void bta_gattc_write_cmpl(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_write_cmpl() argument
912 GATT_WRITE_OP_CB cb = p_clcb->p_q_cmd->api_write.write_cb; in bta_gattc_write_cmpl()
913 void* my_cb_data = p_clcb->p_q_cmd->api_write.write_cb_data; in bta_gattc_write_cmpl()
915 osi_free_and_reset((void**)&p_clcb->p_q_cmd); in bta_gattc_write_cmpl()
918 cb(p_clcb->bta_conn_id, p_data->status, p_data->p_cmpl->att_value.handle, in bta_gattc_write_cmpl()
924 static void bta_gattc_exec_cmpl(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_exec_cmpl() argument
928 osi_free_and_reset((void**)&p_clcb->p_q_cmd); in bta_gattc_exec_cmpl()
929 p_clcb->status = GATT_SUCCESS; in bta_gattc_exec_cmpl()
932 cb_data.exec_cmpl.conn_id = p_clcb->bta_conn_id; in bta_gattc_exec_cmpl()
935 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_EXEC_EVT, &cb_data); in bta_gattc_exec_cmpl()
939 static void bta_gattc_cfg_mtu_cmpl(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_cfg_mtu_cmpl() argument
941 GATT_CONFIGURE_MTU_OP_CB cb = p_clcb->p_q_cmd->api_mtu.mtu_cb; in bta_gattc_cfg_mtu_cmpl()
942 void* my_cb_data = p_clcb->p_q_cmd->api_mtu.mtu_cb_data; in bta_gattc_cfg_mtu_cmpl()
945 osi_free_and_reset((void**)&p_clcb->p_q_cmd); in bta_gattc_cfg_mtu_cmpl()
948 p_clcb->p_srcb->mtu = p_data->p_cmpl->mtu; in bta_gattc_cfg_mtu_cmpl()
951 p_clcb->status = p_data->status; in bta_gattc_cfg_mtu_cmpl()
952 cb_data.cfg_mtu.conn_id = p_clcb->bta_conn_id; in bta_gattc_cfg_mtu_cmpl()
954 cb_data.cfg_mtu.mtu = p_clcb->p_srcb->mtu; in bta_gattc_cfg_mtu_cmpl()
957 cb(p_clcb->bta_conn_id, p_data->status, my_cb_data); in bta_gattc_cfg_mtu_cmpl()
960 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_CFG_MTU_EVT, &cb_data); in bta_gattc_cfg_mtu_cmpl()
964 void bta_gattc_op_cmpl(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_op_cmpl() argument
965 if (p_clcb->p_q_cmd == NULL) { in bta_gattc_op_cmpl()
987 if (p_clcb->p_q_cmd->hdr.event != in bta_gattc_op_cmpl()
990 p_clcb->p_q_cmd->hdr.event - BTA_GATTC_API_READ_EVT + GATTC_OPTYPE_READ; in bta_gattc_op_cmpl()
995 bta_gattc_op_code_name[mapped_op], p_clcb->p_q_cmd->hdr.event, in bta_gattc_op_cmpl()
1003 if (p_clcb->auto_update == BTA_GATTC_DISC_WAITING && in bta_gattc_op_cmpl()
1004 p_clcb->p_srcb->srvc_hdl_chg && op != GATTC_OPTYPE_CONFIG) { in bta_gattc_op_cmpl()
1013 bta_gattc_read_cmpl(p_clcb, &p_data->op_cmpl); in bta_gattc_op_cmpl()
1016 bta_gattc_write_cmpl(p_clcb, &p_data->op_cmpl); in bta_gattc_op_cmpl()
1019 bta_gattc_exec_cmpl(p_clcb, &p_data->op_cmpl); in bta_gattc_op_cmpl()
1022 bta_gattc_cfg_mtu_cmpl(p_clcb, &p_data->op_cmpl); in bta_gattc_op_cmpl()
1029 p_clcb->auto_update = BTA_GATTC_REQ_WAITING; in bta_gattc_op_cmpl()
1031 p_clcb->p_srcb->srvc_hdl_db_hash = true; in bta_gattc_op_cmpl()
1032 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_DISCOVER_EVT, NULL); in bta_gattc_op_cmpl()
1036 if (p_clcb->auto_update == BTA_GATTC_DISC_WAITING) { in bta_gattc_op_cmpl()
1037 p_clcb->auto_update = BTA_GATTC_REQ_WAITING; in bta_gattc_op_cmpl()
1041 p_clcb->p_srcb->srvc_hdl_db_hash = true; in bta_gattc_op_cmpl()
1044 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_DISCOVER_EVT, NULL); in bta_gattc_op_cmpl()
1049 void bta_gattc_search(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_search() argument
1052 VLOG(1) << __func__ << ": conn_id=" << loghex(p_clcb->bta_conn_id); in bta_gattc_search()
1053 if (p_clcb->p_srcb && !p_clcb->p_srcb->gatt_database.IsEmpty()) { in bta_gattc_search()
1056 bta_gattc_search_service(p_clcb, p_data->api_search.p_srvc_uuid); in bta_gattc_search()
1059 cb_data.search_cmpl.conn_id = p_clcb->bta_conn_id; in bta_gattc_search()
1062 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_SEARCH_CMPL_EVT, &cb_data); in bta_gattc_search()
1067 void bta_gattc_q_cmd(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { in bta_gattc_q_cmd() argument
1068 bta_gattc_enqueue(p_clcb, p_data); in bta_gattc_q_cmd()
1072 void bta_gattc_fail(tBTA_GATTC_CLCB* p_clcb, in bta_gattc_fail() argument
1074 if (p_clcb->status == GATT_SUCCESS) { in bta_gattc_fail()
1075 LOG(ERROR) << "operation not supported at current state " << +p_clcb->state; in bta_gattc_fail()
1135 tBTA_GATTC_CLCB* p_clcb = in bta_gattc_enc_cmpl_cback() local
1138 if (p_clcb == NULL) return; in bta_gattc_enc_cmpl_cback()
1162 tBTA_GATTC_CLCB* p_clcb = &bta_gattc_cb.clcb[0]; in bta_gattc_process_api_refresh() local
1163 for (uint8_t i = 0; i < BTA_GATTC_CLCB_MAX; i++, p_clcb++) { in bta_gattc_process_api_refresh()
1164 if (p_clcb->in_use && p_clcb->p_srcb == p_srvc_cb) { in bta_gattc_process_api_refresh()
1170 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_DISCOVER_EVT, NULL); in bta_gattc_process_api_refresh()
1186 tBTA_GATTC_CLCB* p_clcb, in bta_gattc_process_srvc_chg_ind() argument
1227 if (p_clcb == NULL || (p_clcb && p_clcb->p_q_cmd != NULL)) { in bta_gattc_process_srvc_chg_ind()
1232 p_clcb = &bta_gattc_cb.clcb[i]; in bta_gattc_process_srvc_chg_ind()
1241 if (p_clcb) { in bta_gattc_process_srvc_chg_ind()
1246 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_DISCOVER_EVT, NULL); in bta_gattc_process_srvc_chg_ind()
1262 void bta_gattc_proc_other_indication(tBTA_GATTC_CLCB* p_clcb, uint8_t op, in bta_gattc_proc_other_indication() argument
1273 p_notify->bda = p_clcb->bda; in bta_gattc_proc_other_indication()
1275 p_notify->conn_id = p_clcb->bta_conn_id; in bta_gattc_proc_other_indication()
1277 if (p_clcb->p_rcb->p_cback) { in bta_gattc_proc_other_indication()
1280 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_NOTIF_EVT, &bta_gattc); in bta_gattc_proc_other_indication()
1316 tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id); in bta_gattc_process_indicate() local
1322 if (bta_gattc_process_srvc_chg_ind(conn_id, p_clrcb, p_srcb, p_clcb, &notify, in bta_gattc_process_indicate()
1329 if (p_clcb == NULL) { in bta_gattc_process_indicate()
1330 p_clcb = bta_gattc_clcb_alloc(gatt_if, remote_bda, transport); in bta_gattc_process_indicate()
1332 if (p_clcb == NULL) { in bta_gattc_process_indicate()
1337 p_clcb->bta_conn_id = conn_id; in bta_gattc_process_indicate()
1338 p_clcb->transport = transport; in bta_gattc_process_indicate()
1340 bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_CONN_EVT, NULL); in bta_gattc_process_indicate()
1343 if (p_clcb != NULL) in bta_gattc_process_indicate()
1344 bta_gattc_proc_other_indication(p_clcb, op, p_data, &notify); in bta_gattc_process_indicate()
1366 tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id); in bta_gattc_cmpl_cback() local
1367 if (!p_clcb) { in bta_gattc_cmpl_cback()
1374 if (p_clcb->transport == BT_TRANSPORT_BR_EDR) { in bta_gattc_cmpl_cback()
1375 bta_sys_busy(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); in bta_gattc_cmpl_cback()
1376 bta_sys_idle(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); in bta_gattc_cmpl_cback()
1404 tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id); in bta_gattc_cong_cback() local
1405 if (!p_clcb || !p_clcb->p_rcb->p_cback) return; in bta_gattc_cong_cback()
1411 (*p_clcb->p_rcb->p_cback)(BTA_GATTC_CONGEST_EVT, &cb_data); in bta_gattc_cong_cback()