Lines Matching refs:p_cb
191 tBTA_HH_DEV_CB *p_cb = bta_hh_cb.p_cur;
196 if ((result == SDP_SUCCESS) && (p_cb != NULL))
199 if (p_cb->sec_mask)
203 APPL_TRACE_EVENT("bta_hh_sdp_cback: p_cb: %d result 0x%02x, \
205 p_cb, result, attr_mask,p_cb->hid_handle);
209 if (bta_hh_tod_spt(p_cb, sdp_rec->sub_class))
212 if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE)
215 if(HID_HostAddDev (p_cb->addr, attr_mask, &hdl) == HID_SUCCESS)
219 bta_hh_cb.cb_index[hdl] = p_cb->index;
223 p_cb->app_id = 0;
228 hdl = p_cb->hid_handle;
232 if (p_cb->app_id != 0)
235 bta_hh_add_device_to_list(p_cb, hdl, attr_mask,
240 p_cb->app_id);
242 p_cb->dscp_info.ctry_code = sdp_rec->ctry_code;
256 bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, (tBTA_HH_DATA *)&status);
271 tBTA_HH_DEV_CB *p_cb = bta_hh_cb.p_cur;
276 APPL_TRACE_EVENT("bta_hh_di_sdp_cback: p_cb: %d result 0x%02x", p_cb, result);
283 if (((result == SDP_SUCCESS) || (result == SDP_NO_RECS_MATCH)) && (p_cb != NULL))
290 bta_hh_update_di_info(p_cb, di_rec.rec.vendor, di_rec.rec.product, di_rec.rec.version, 0);
296 bta_hh_update_di_info(p_cb, BTA_HH_VENDOR_ID_INVALID, 0, 0, 0);
299 if ((ret = HID_HostGetSDPRecord(p_cb->addr,
320 bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, (tBTA_HH_DATA *)&status);
339 void bta_hh_start_sdp(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
344 p_cb->sec_mask = p_data->api_conn.sec_mask;
345 p_cb->mode = p_data->api_conn.mode;
346 bta_hh_cb.p_cur = p_cb;
349 if (bta_hh_is_le_device(p_cb, p_data->api_conn.bd_addr))
351 bta_hh_le_open_conn(p_cb, p_data->api_conn.bd_addr);
357 if (p_cb->app_id)
363 if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE)
365 if (HID_HostAddDev (p_cb->addr, p_cb->attr_mask, &hdl) \
369 bta_hh_add_device_to_list(p_cb, hdl, p_cb->attr_mask, NULL,
370 p_cb->sub_class,
371 p_cb->dscp_info.ssr_max_latency,
372 p_cb->dscp_info.ssr_min_tout,
373 p_cb->app_id);
375 bta_hh_cb.cb_index[hdl] = p_cb->index;
380 bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, (tBTA_HH_DATA *)&status);
395 bta_hh_cb.p_cur = p_cb;
415 bta_hh_sm_execute(p_cb, BTA_HH_SDP_CMPL_EVT, (tBTA_HH_DATA *)&status);
431 void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
442 conn_dat.handle = p_cb->hid_handle;
443 bdcpy(conn_dat.bda, p_cb->addr);
449 if (!p_cb->incoming_conn)
453 HID_HostSetSecurityLevel("", p_cb->sec_mask);
456 if ((ret = HID_HostOpenDev (p_cb->hid_handle)) != HID_SUCCESS)
463 HID_HostRemoveDev( p_cb->hid_handle);
473 bta_hh_sm_execute(p_cb, BTA_HH_OPEN_CMPL_EVT, NULL);
484 (p_cb->incoming_conn) &&(p_cb->app_id == 0))
487 p_cb->incoming_hid_handle);
488 HID_HostRemoveDev( p_cb->incoming_hid_handle);
494 bta_hh_sm_execute(p_cb, BTA_HH_API_CLOSE_EVT, NULL);
497 if (p_cb->app_id == 0 && !p_cb->incoming_conn)
500 bta_hh_clean_up_kdev(p_cb);
519 void bta_hh_api_disc_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
525 if (p_cb->is_le_device)
526 bta_hh_le_api_disc_act(p_cb);
531 disc_dat.handle = p_data ?(UINT8)p_data->hdr.layer_specific :p_cb->hid_handle;
553 void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
557 p_cb->hid_handle;
561 bdcpy(conn.bda, p_cb->addr);
567 bta_hh_co_open(p_cb->hid_handle, p_cb->sub_class,
568 p_cb->attr_mask, p_cb->app_id);
571 conn.status = p_cb->status;
572 conn.le_hid = p_cb->is_le_device;
573 conn.scps_supported = p_cb->scps_supported;
575 if (!p_cb->is_le_device)
579 bta_sys_conn_open( BTA_ID_HH ,p_cb->app_id, p_cb->addr);
582 if ( p_cb->mode != BTA_HH_PROTO_RPT_MODE
584 && !p_cb->is_le_device
600 p_cb->w4_evt = BTA_HH_OPEN_EVT;
606 p_cb->incoming_conn = FALSE;
607 p_cb->incoming_hid_handle = BTA_HH_INVALID_HANDLE;
620 void bta_hh_open_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
625 p_cb->hid_handle;
632 if (p_cb->app_id != 0)
634 bta_hh_sm_execute(p_cb, BTA_HH_OPEN_CMPL_EVT, p_data);
640 p_cb->incoming_conn = TRUE;
642 p_cb->incoming_hid_handle = dev_handle;
645 bdcpy(conn_data.bd_addr, p_cb->addr);
646 bta_hh_start_sdp(p_cb, (tBTA_HH_DATA *)&conn_data);
663 void bta_hh_data_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA * p_data)
669 p_cb->mode, p_cb->sub_class, p_cb->dscp_info.ctry_code, p_cb->addr, p_cb->app_id);
685 void bta_hh_handsk_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA * p_data)
693 bta_hh_get_w4_event(p_cb->w4_evt), p_data->hid_cback.data);
699 switch (p_cb->w4_evt)
707 hs_data.handle = p_cb->hid_handle;
712 (* bta_hh_cb.p_cback)(p_cb->w4_evt, (tBTA_HH *)&hs_data);
713 p_cb->w4_evt = 0;
720 cback_data.handle = p_cb->hid_handle;
722 (* bta_hh_cb.p_cback)(p_cb->w4_evt, (tBTA_HH *)&cback_data);
723 p_cb->w4_evt = 0;
729 conn.handle = p_cb->hid_handle;
730 bdcpy(conn.bda, p_cb->addr);
731 (* bta_hh_cb.p_cback)(p_cb->w4_evt, (tBTA_HH *)&conn);
735 p_cb->w4_evt = 0;
745 bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr);
758 void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA * p_data)
766 bta_hh_get_w4_event(p_cb->w4_evt));
769 hs_data.handle = p_cb->hid_handle;
771 switch (p_cb->w4_evt)
798 bta_hh_get_w4_event(p_cb->w4_evt));
804 bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr);
805 bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr);
807 (* bta_hh_cb.p_cback)(p_cb->w4_evt, (tBTA_HH *)&hs_data);
809 p_cb->w4_evt = 0;
825 void bta_hh_open_failure(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
831 conn_dat.handle = p_cb->hid_handle;
834 bdcpy(conn_dat.bda, p_cb->addr);
835 HID_HostCloseDev(p_cb->hid_handle);
844 p_cb->vp = FALSE;
845 p_cb->w4_evt = 0;
865 void bta_hh_close_act (tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
872 UINT16 event = p_cb->vp ? BTA_HH_VC_UNPLUG_EVT : BTA_HH_CLOSE_EVT;
874 disc_dat.handle = p_cb->hid_handle;
883 conn_dat.handle = p_cb->hid_handle;
885 bdcpy(conn_dat.bda, p_cb->addr);
886 HID_HostCloseDev(p_cb->hid_handle);
900 bta_hh_co_close(p_cb->hid_handle, p_cb->app_id);
902 bta_sys_conn_close( BTA_ID_HH ,p_cb->app_id, p_cb->addr);
912 if (p_cb->vp )
914 HID_HostRemoveDev( p_cb->hid_handle);
915 bta_hh_clean_up_kdev(p_cb);
924 p_cb->vp = FALSE;
925 p_cb->w4_evt = 0;
946 void bta_hh_get_dscp_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
951 if (p_cb->is_le_device)
953 bta_hh_le_get_dscp_act(p_cb);
957 (*bta_hh_cb.p_cback)(BTA_HH_GET_DSCP_EVT, (tBTA_HH *)&p_cb->dscp_info);
970 void bta_hh_maint_dev_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
984 if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE)
987 if (bta_hh_is_le_device(p_cb, p_data->api_conn.bd_addr))
989 dev_info.handle = bta_hh_le_add_device(p_cb, p_dev_info);
1003 bta_hh_update_di_info(p_cb,
1009 bta_hh_update_di_info(p_cb,
1017 bta_hh_add_device_to_list(p_cb, dev_handle,
1025 bta_hh_cb.cb_index[dev_handle] = p_cb->index;
1030 dev_info.handle = p_cb->hid_handle;
1040 bdcpy(dev_info.bda, p_cb->addr);
1043 if (p_cb->is_le_device)
1045 bta_hh_le_remove_dev_bg_conn(p_cb);
1046 bta_hh_sm_execute(p_cb, BTA_HH_API_CLOSE_EVT, NULL);
1047 bta_hh_clean_up_kdev(p_cb);
1057 bta_hh_clean_up_kdev(p_cb);
1078 void bta_hh_write_dev_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
1085 if (p_cb->is_le_device)
1086 bta_hh_le_write_dev_act(p_cb, p_data);
1091 cbdata.handle = p_cb->hid_handle;
1100 if (HID_HostWriteDev (p_cb->hid_handle,
1132 p_cb->w4_evt = event;
1140 p_cb->vp = TRUE;
1155 bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr);
1156 bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr);
1160 bta_sys_sco_close(BTA_ID_HH, p_cb->app_id, p_cb->addr);
1164 bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr);