Lines Matching refs:p_cb
180 tBTA_HH_DEV_CB* p_cb = bta_hh_cb.p_cur; in bta_hh_sdp_cback() local
185 if ((result == SDP_SUCCESS) && (p_cb != NULL)) { in bta_hh_sdp_cback()
187 if (p_cb->sec_mask) attr_mask |= HID_SEC_REQUIRED; in bta_hh_sdp_cback()
191 __func__, p_cb, result, attr_mask, p_cb->hid_handle); in bta_hh_sdp_cback()
196 if (bta_hh_tod_spt(p_cb, sdp_rec->sub_class)) { in bta_hh_sdp_cback()
198 if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE) { in bta_hh_sdp_cback()
200 if (HID_HostAddDev(p_cb->addr, attr_mask, &hdl) == HID_SUCCESS) { in bta_hh_sdp_cback()
203 bta_hh_cb.cb_index[hdl] = p_cb->index; in bta_hh_sdp_cback()
205 p_cb->app_id = 0; in bta_hh_sdp_cback()
208 hdl = p_cb->hid_handle; in bta_hh_sdp_cback()
213 if (p_cb->app_id != 0) { in bta_hh_sdp_cback()
215 bta_hh_add_device_to_list(p_cb, hdl, attr_mask, &sdp_rec->dscp_info, in bta_hh_sdp_cback()
217 sdp_rec->ssr_min_tout, p_cb->app_id); in bta_hh_sdp_cback()
219 p_cb->dscp_info.ctry_code = sdp_rec->ctry_code; in bta_hh_sdp_cback()
234 bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); in bta_hh_sdp_cback()
248 tBTA_HH_DEV_CB* p_cb = bta_hh_cb.p_cur; in bta_hh_di_sdp_cback() local
253 APPL_TRACE_EVENT("%s: p_cb: %d result 0x%02x", __func__, p_cb, result); in bta_hh_di_sdp_cback()
263 (p_cb != NULL)) { in bta_hh_di_sdp_cback()
268 bta_hh_update_di_info(p_cb, di_rec.rec.vendor, di_rec.rec.product, in bta_hh_di_sdp_cback()
274 bta_hh_update_di_info(p_cb, BTA_HH_VENDOR_ID_INVALID, 0, 0, 0); in bta_hh_di_sdp_cback()
277 ret = HID_HostGetSDPRecord(p_cb->addr, bta_hh_cb.p_disc_db, in bta_hh_di_sdp_cback()
294 bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); in bta_hh_di_sdp_cback()
311 void bta_hh_start_sdp(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_start_sdp() argument
315 p_cb->sec_mask = p_data->api_conn.sec_mask; in bta_hh_start_sdp()
316 p_cb->mode = p_data->api_conn.mode; in bta_hh_start_sdp()
317 bta_hh_cb.p_cur = p_cb; in bta_hh_start_sdp()
320 if (bta_hh_is_le_device(p_cb, p_data->api_conn.bd_addr)) { in bta_hh_start_sdp()
321 bta_hh_le_open_conn(p_cb, p_data->api_conn.bd_addr); in bta_hh_start_sdp()
327 if (p_cb->app_id) { in bta_hh_start_sdp()
332 if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE) { in bta_hh_start_sdp()
333 if (HID_HostAddDev(p_cb->addr, p_cb->attr_mask, &hdl) == HID_SUCCESS) { in bta_hh_start_sdp()
335 bta_hh_add_device_to_list(p_cb, hdl, p_cb->attr_mask, NULL, in bta_hh_start_sdp()
336 p_cb->sub_class, in bta_hh_start_sdp()
337 p_cb->dscp_info.ssr_max_latency, in bta_hh_start_sdp()
338 p_cb->dscp_info.ssr_min_tout, p_cb->app_id); in bta_hh_start_sdp()
340 bta_hh_cb.cb_index[hdl] = p_cb->index; in bta_hh_start_sdp()
346 bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); in bta_hh_start_sdp()
354 bta_hh_cb.p_cur = p_cb; in bta_hh_start_sdp()
383 bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, &bta_hh_data); in bta_hh_start_sdp()
399 void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_sdp_cmpl() argument
409 conn_dat.handle = p_cb->hid_handle; in bta_hh_sdp_cmpl()
410 conn_dat.bda = p_cb->addr; in bta_hh_sdp_cmpl()
415 if (!p_cb->incoming_conn) { in bta_hh_sdp_cmpl()
418 HID_HostSetSecurityLevel("", p_cb->sec_mask); in bta_hh_sdp_cmpl()
421 ret = HID_HostOpenDev(p_cb->hid_handle); in bta_hh_sdp_cmpl()
437 HID_HostRemoveDev(p_cb->hid_handle); in bta_hh_sdp_cmpl()
442 bta_hh_sm_execute(p_cb, BTA_HH_OPEN_CMPL_EVT, NULL); in bta_hh_sdp_cmpl()
452 if ((status == BTA_HH_ERR_SDP) && (p_cb->incoming_conn) && in bta_hh_sdp_cmpl()
453 (p_cb->app_id == 0)) { in bta_hh_sdp_cmpl()
455 p_cb->incoming_hid_handle); in bta_hh_sdp_cmpl()
456 HID_HostRemoveDev(p_cb->incoming_hid_handle); in bta_hh_sdp_cmpl()
462 bta_hh_sm_execute(p_cb, BTA_HH_API_CLOSE_EVT, NULL); in bta_hh_sdp_cmpl()
465 if (p_cb->app_id == 0 && !p_cb->incoming_conn) { in bta_hh_sdp_cmpl()
467 bta_hh_clean_up_kdev(p_cb); in bta_hh_sdp_cmpl()
486 void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_api_disc_act() argument
491 if (p_cb->is_le_device) in bta_hh_api_disc_act()
492 bta_hh_le_api_disc_act(p_cb); in bta_hh_api_disc_act()
498 p_data ? (uint8_t)p_data->hdr.layer_specific : p_cb->hid_handle; in bta_hh_api_disc_act()
522 void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_open_cmpl_act() argument
525 p_data ? (uint8_t)p_data->hid_cback.hdr.layer_specific : p_cb->hid_handle; in bta_hh_open_cmpl_act()
529 conn.bda = p_cb->addr; in bta_hh_open_cmpl_act()
535 bta_hh_co_open(p_cb->hid_handle, p_cb->sub_class, p_cb->attr_mask, in bta_hh_open_cmpl_act()
536 p_cb->app_id); in bta_hh_open_cmpl_act()
539 conn.status = p_cb->status; in bta_hh_open_cmpl_act()
540 conn.le_hid = p_cb->is_le_device; in bta_hh_open_cmpl_act()
541 conn.scps_supported = p_cb->scps_supported; in bta_hh_open_cmpl_act()
543 if (!p_cb->is_le_device) in bta_hh_open_cmpl_act()
547 bta_sys_conn_open(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_open_cmpl_act()
550 if (p_cb->mode != BTA_HH_PROTO_RPT_MODE in bta_hh_open_cmpl_act()
552 && !p_cb->is_le_device in bta_hh_open_cmpl_act()
563 p_cb->w4_evt = BTA_HH_OPEN_EVT; in bta_hh_open_cmpl_act()
568 p_cb->incoming_conn = false; in bta_hh_open_cmpl_act()
569 p_cb->incoming_hid_handle = BTA_HH_INVALID_HANDLE; in bta_hh_open_cmpl_act()
581 void bta_hh_open_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_open_act() argument
585 p_data ? (uint8_t)p_data->hid_cback.hdr.layer_specific : p_cb->hid_handle; in bta_hh_open_act()
592 if (p_cb->app_id != 0) { in bta_hh_open_act()
593 bta_hh_sm_execute(p_cb, BTA_HH_OPEN_CMPL_EVT, p_data); in bta_hh_open_act()
599 p_cb->incoming_conn = true; in bta_hh_open_act()
601 p_cb->incoming_hid_handle = dev_handle; in bta_hh_open_act()
604 conn_data.bd_addr = p_cb->addr; in bta_hh_open_act()
605 bta_hh_start_sdp(p_cb, (tBTA_HH_DATA*)&conn_data); in bta_hh_open_act()
621 void bta_hh_data_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_data_act() argument
626 pdata->len, p_cb->mode, p_cb->sub_class, in bta_hh_data_act()
627 p_cb->dscp_info.ctry_code, p_cb->addr, p_cb->app_id); in bta_hh_data_act()
642 void bta_hh_handsk_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_handsk_act() argument
645 bta_hh_get_w4_event(p_cb->w4_evt), p_data->hid_cback.data); in bta_hh_handsk_act()
651 switch (p_cb->w4_evt) { in bta_hh_handsk_act()
658 bta_hh.hs_data.handle = p_cb->hid_handle; in bta_hh_handsk_act()
663 if (p_cb->w4_evt == BTA_HH_GET_RPT_EVT) in bta_hh_handsk_act()
666 (*bta_hh_cb.p_cback)(p_cb->w4_evt, &bta_hh); in bta_hh_handsk_act()
667 p_cb->w4_evt = 0; in bta_hh_handsk_act()
674 bta_hh.dev_status.handle = p_cb->hid_handle; in bta_hh_handsk_act()
677 if (p_cb->w4_evt == BTA_HH_SET_RPT_EVT) in bta_hh_handsk_act()
680 (*bta_hh_cb.p_cback)(p_cb->w4_evt, &bta_hh); in bta_hh_handsk_act()
681 p_cb->w4_evt = 0; in bta_hh_handsk_act()
688 bta_hh.conn.handle = p_cb->hid_handle; in bta_hh_handsk_act()
689 bta_hh.conn.bda = p_cb->addr; in bta_hh_handsk_act()
690 (*bta_hh_cb.p_cback)(p_cb->w4_evt, &bta_hh); in bta_hh_handsk_act()
694 p_cb->w4_evt = 0; in bta_hh_handsk_act()
704 bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_handsk_act()
717 void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_ctrl_dat_act() argument
724 bta_hh_get_w4_event(p_cb->w4_evt)); in bta_hh_ctrl_dat_act()
728 p_cb->w4_evt = 0; in bta_hh_ctrl_dat_act()
733 hs_data.handle = p_cb->hid_handle; in bta_hh_ctrl_dat_act()
735 switch (p_cb->w4_evt) { in bta_hh_ctrl_dat_act()
766 bta_hh_get_w4_event(p_cb->w4_evt)); in bta_hh_ctrl_dat_act()
772 bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_ctrl_dat_act()
773 bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_ctrl_dat_act()
775 (*bta_hh_cb.p_cback)(p_cb->w4_evt, (tBTA_HH*)&hs_data); in bta_hh_ctrl_dat_act()
777 p_cb->w4_evt = 0; in bta_hh_ctrl_dat_act()
792 void bta_hh_open_failure(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_open_failure() argument
797 conn_dat.handle = p_cb->hid_handle; in bta_hh_open_failure()
800 conn_dat.bda = p_cb->addr; in bta_hh_open_failure()
801 HID_HostCloseDev(p_cb->hid_handle); in bta_hh_open_failure()
810 p_cb->vp = false; in bta_hh_open_failure()
811 p_cb->w4_evt = 0; in bta_hh_open_failure()
819 p_cb->incoming_conn = false; in bta_hh_open_failure()
820 p_cb->incoming_hid_handle = BTA_HH_INVALID_HANDLE; in bta_hh_open_failure()
833 void bta_hh_close_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_close_act() argument
839 uint16_t event = p_cb->vp ? BTA_HH_VC_UNPLUG_EVT : BTA_HH_CLOSE_EVT; in bta_hh_close_act()
841 disc_dat.handle = p_cb->hid_handle; in bta_hh_close_act()
853 conn_dat.handle = p_cb->hid_handle; in bta_hh_close_act()
856 conn_dat.bda = p_cb->addr; in bta_hh_close_act()
857 HID_HostCloseDev(p_cb->hid_handle); in bta_hh_close_act()
870 bta_hh_co_close(p_cb->hid_handle, p_cb->app_id); in bta_hh_close_act()
872 bta_sys_conn_close(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_close_act()
881 if (p_cb->vp) { in bta_hh_close_act()
882 HID_HostRemoveDev(p_cb->hid_handle); in bta_hh_close_act()
883 bta_hh_clean_up_kdev(p_cb); in bta_hh_close_act()
892 p_cb->vp = false; in bta_hh_close_act()
893 p_cb->w4_evt = 0; in bta_hh_close_act()
913 void bta_hh_get_dscp_act(tBTA_HH_DEV_CB* p_cb, in bta_hh_get_dscp_act() argument
916 if (p_cb->is_le_device) { in bta_hh_get_dscp_act()
917 bta_hh_le_get_dscp_act(p_cb); in bta_hh_get_dscp_act()
920 (*bta_hh_cb.p_cback)(BTA_HH_GET_DSCP_EVT, (tBTA_HH*)&p_cb->dscp_info); in bta_hh_get_dscp_act()
933 void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_maint_dev_act() argument
945 if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE) { in bta_hh_maint_dev_act()
947 if (bta_hh_is_le_device(p_cb, p_data->api_conn.bd_addr)) { in bta_hh_maint_dev_act()
948 dev_info.handle = bta_hh_le_add_device(p_cb, p_dev_info); in bta_hh_maint_dev_act()
961 bta_hh_update_di_info(p_cb, p_dev_info->dscp_info.vendor_id, in bta_hh_maint_dev_act()
966 bta_hh_update_di_info(p_cb, p_dev_info->dscp_info.vendor_id, in bta_hh_maint_dev_act()
973 p_cb, dev_handle, p_dev_info->attr_mask, in bta_hh_maint_dev_act()
978 bta_hh_cb.cb_index[dev_handle] = p_cb->index; in bta_hh_maint_dev_act()
982 dev_info.handle = p_cb->hid_handle; in bta_hh_maint_dev_act()
992 dev_info.bda = p_cb->addr; in bta_hh_maint_dev_act()
995 if (p_cb->is_le_device) { in bta_hh_maint_dev_act()
996 bta_hh_le_remove_dev_bg_conn(p_cb); in bta_hh_maint_dev_act()
997 bta_hh_sm_execute(p_cb, BTA_HH_API_CLOSE_EVT, NULL); in bta_hh_maint_dev_act()
998 bta_hh_clean_up_kdev(p_cb); in bta_hh_maint_dev_act()
1006 bta_hh_clean_up_kdev(p_cb); in bta_hh_maint_dev_act()
1027 void bta_hh_write_dev_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) { in bta_hh_write_dev_act() argument
1033 if (p_cb->is_le_device) in bta_hh_write_dev_act()
1034 bta_hh_le_write_dev_act(p_cb, p_data); in bta_hh_write_dev_act()
1039 cbdata.handle = p_cb->hid_handle; in bta_hh_write_dev_act()
1049 if (HID_HostWriteDev(p_cb->hid_handle, p_data->api_sndcmd.t_type, in bta_hh_write_dev_act()
1075 p_cb->w4_evt = event; in bta_hh_write_dev_act()
1083 p_cb->vp = true; in bta_hh_write_dev_act()
1097 bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_write_dev_act()
1098 bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_write_dev_act()
1100 bta_sys_sco_close(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_write_dev_act()
1102 bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr); in bta_hh_write_dev_act()