Lines Matching defs:p_dev
154 extern void bta_hh_co_send_hid_info(btif_hh_device_t *p_dev, char *dev_name, UINT16 vendor_id,
166 static void sync_lockstate_on_connect(btif_hh_device_t *p_dev);
167 //static void hh_update_keyboard_lockstates(btif_hh_device_t *p_dev);
254 static void update_keyboard_lockstates(btif_hh_device_t *p_dev)
261 __FUNCTION__, p_dev->dev_handle, btif_hh_keylockstates);
263 if (p_dev->p_buf != NULL) {
264 GKI_freebuf(p_dev->p_buf);
267 p_dev->p_buf = GKI_getbuf((UINT16) (len + BTA_HH_MIN_OFFSET +
269 if (p_dev->p_buf != NULL) {
270 p_dev->p_buf->len = len;
271 p_dev->p_buf->offset = BTA_HH_MIN_OFFSET;
272 p_dev->p_buf->layer_specific = BTA_HH_RPTT_OUTPUT;
275 UINT8 *pbuf_data = (UINT8 *)(p_dev->p_buf + 1)
276 + p_dev->p_buf->offset;
279 bda = (BD_ADDR*) (&p_dev->bd_addr);
280 BTA_HhSendData(p_dev->dev_handle, *bda,
281 p_dev->p_buf);
293 static void sync_lockstate_on_connect(btif_hh_device_t *p_dev)
300 update_keyboard_lockstates(p_dev);
312 toggle_os_keylockstates(p_dev->fd, keylockstates);
418 btif_hh_device_t *p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
419 if(p_dev != NULL)
421 if (p_dev->vup_timer_active)
424 btu_stop_timer(&p_dev->vup_timer);
426 p_dev->vup_timer_active = FALSE;
439 btif_hh_device_t *p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
441 if (p_dev->vup_timer_active == FALSE)
444 memset(&p_dev->vup_timer, 0, sizeof(TIMER_LIST_ENT));
445 p_dev->vup_timer.param = (UINT32)btif_hh_tmr_hdlr;
446 btu_start_timer(&p_dev->vup_timer, BTU_TTYPE_USER_FUNC,
452 btu_stop_timer(&p_dev->vup_timer);
453 btu_start_timer(&p_dev->vup_timer, BTU_TTYPE_USER_FUNC,
456 p_dev->vup_timer_active = TRUE;
510 btif_hh_device_t *p_dev;
527 p_dev = btif_hh_find_dev_by_bda(&bd_addr);
528 if (p_dev == NULL) {
534 p_dev->dev_status = BTHH_CONN_STATE_UNKNOWN;
535 p_dev->dev_handle = BTA_HH_INVALID_HANDLE;
542 if (p_dev->p_buf != NULL) {
543 GKI_freebuf(p_dev->p_buf);
544 p_dev->p_buf = NULL;
547 p_dev->hh_keep_polling = 0;
548 p_dev->hh_poll_thread_id = -1;
549 BTIF_TRACE_DEBUG2("%s: uhid fd = %d", __FUNCTION__, p_dev->fd);
550 if (p_dev->fd >= 0) {
551 bta_hh_co_destroy(p_dev->fd);
552 p_dev->fd = -1;
593 btif_hh_device_t *p_dev;
598 p_dev = btif_hh_find_dev_by_bda(bd_addr);
599 if ((p_dev != NULL) && (p_dev->dev_status == BTHH_CONN_STATE_CONNECTED)
600 && (p_dev->attr_mask & HID_VIRTUAL_CABLE))
605 BTA_HhSendCtrl(p_dev->dev_handle, BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG);
697 btif_hh_device_t *p_dev;
698 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
699 if (p_dev != NULL)
701 BTA_HhClose(p_dev->dev_handle);
717 void btif_hh_setreport(btif_hh_device_t *p_dev, bthh_report_type_t r_type, UINT16 size,
723 if (p_dev->p_buf != NULL) {
724 GKI_freebuf(p_dev->p_buf);
726 p_dev->p_buf = GKI_getbuf((UINT16) (len + BTA_HH_MIN_OFFSET + sizeof(BT_HDR)));
727 if (p_dev->p_buf == NULL) {
732 p_dev->p_buf->len = len;
733 p_dev->p_buf->offset = BTA_HH_MIN_OFFSET;
741 pbuf_data = (UINT8*) (p_dev->p_buf + 1) + p_dev->p_buf->offset;
743 BTA_HhSetReport(p_dev->dev_handle, r_type, p_dev->p_buf);
771 btif_hh_device_t *p_dev = NULL;
810 p_dev = btif_hh_find_connected_dev_by_handle(p_data->conn.handle);
811 if (p_dev == NULL) {
819 else if (p_dev->fd < 0) {
821 memcpy(&(p_dev->bd_addr), p_data->conn.bda, BD_ADDR_LEN);
828 memcpy(&(p_dev->bd_addr), p_data->conn.bda, BD_ADDR_LEN);
836 p_dev->dev_status = BTHH_CONN_STATE_CONNECTED;
837 HAL_CBACK(bt_hh_callbacks, connection_state_cb,&(p_dev->bd_addr), p_dev->dev_status);
849 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle);
850 if (p_dev != NULL) {
851 BTIF_TRACE_DEBUG2("%s: uhid fd = %d", __FUNCTION__, p_dev->fd);
852 if (p_dev->fd >= 0){
856 bta_hh_co_write(p_dev->fd , hidreport, sizeof(hidreport));
858 if(p_dev->vup_timer_active)
860 btif_hh_stop_vup_timer(&(p_dev->bd_addr));
863 p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED;
864 HAL_CBACK(bt_hh_callbacks, connection_state_cb,&(p_dev->bd_addr), p_dev->dev_status);
865 BTIF_TRACE_DEBUG2("%s: Closing uhid fd = %d", __FUNCTION__, p_dev->fd);
866 bta_hh_co_destroy(p_dev->fd);
867 p_dev->fd = -1;
876 p_dev = btif_hh_find_connected_dev_by_handle(p_data->conn.handle);
877 HAL_CBACK(bt_hh_callbacks, get_report_cb,(bt_bdaddr_t*) &(p_dev->bd_addr), (bthh_status_t) p_data->hs_data.status,
884 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle);
885 if (p_dev != NULL && p_dev->p_buf != NULL) {
887 GKI_freebuf(p_dev->p_buf);
888 p_dev->p_buf = NULL;
893 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle);
899 HAL_CBACK(bt_hh_callbacks, protocol_mode_cb,(bt_bdaddr_t*) &(p_dev->bd_addr), (bthh_status_t)p_data->hs_data.status,
924 p_dev = btif_hh_cb.p_curr_dev;
925 if (p_dev == NULL) {
929 if (p_dev->fd < 0) {
941 bta_hh_co_send_hid_info(p_dev, cached_name,
945 if (btif_hh_add_added_dev(p_dev->bd_addr, p_dev->attr_mask)) {
947 bdcpy(bda, p_dev->bd_addr.address);
950 bdcpy(bda, p_dev->bd_addr.address);
953 p_dev->bd_addr.address[0], p_dev->bd_addr.address[1],
954 p_dev->bd_addr.address[2],p_dev->bd_addr.address[3],
955 p_dev->bd_addr.address[4], p_dev->bd_addr.address[5]);
956 BTA_HhAddDev(bda, p_dev->attr_mask,p_dev->sub_class,p_dev->app_id, dscp_info);
958 ret = btif_storage_add_hid_device_info(&(p_dev->bd_addr), p_dev->attr_mask,p_dev->sub_class,p_dev->app_id,
995 sync_lockstate_on_connect(p_dev);
1031 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle);
1033 if (p_dev != NULL) {
1035 p_dev->bd_addr.address[0], p_dev->bd_addr.address[1],
1036 p_dev->bd_addr.address[2],p_dev->bd_addr.address[3],
1037 p_dev->bd_addr.address[4], p_dev->bd_addr.address[5]);
1039 if(p_dev->vup_timer_active)
1041 btif_hh_stop_vup_timer(&(p_dev->bd_addr));
1043 p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED;
1045 HAL_CBACK(bt_hh_callbacks, connection_state_cb,&(p_dev->bd_addr), p_dev->dev_status);
1047 BTA_DmRemoveDevice((UINT8 *)p_dev->bd_addr.address);
1048 HAL_CBACK(bt_hh_callbacks, virtual_unplug_cb,&(p_dev->bd_addr),
1167 btif_hh_device_t *p_dev;
1180 p_dev = &btif_hh_cb.devices[i];
1182 if (p_dev->vup_timer_active)
1184 p_dev->vup_timer_active = FALSE;
1187 p_data.dev_status.handle = p_dev->dev_handle;
1255 btif_hh_device_t *p_dev;
1262 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
1263 if (p_dev != NULL)
1287 btif_hh_device_t *p_dev;
1297 p_dev = btif_hh_find_dev_by_bda(bd_addr);
1298 if (!p_dev)
1374 btif_hh_device_t *p_dev;
1385 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
1386 if (p_dev != NULL) {
1387 //BTA_HhGetIdle(p_dev->dev_handle);
1407 btif_hh_device_t *p_dev;
1418 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
1419 if (p_dev == NULL) {
1425 //BTA_HhSetIdle(p_dev->dev_handle, idle_time);
1442 btif_hh_device_t *p_dev;
1453 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
1454 if (p_dev != NULL) {
1455 BTA_HhGetProtoMode(p_dev->dev_handle);
1475 btif_hh_device_t *p_dev;
1489 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
1490 if (p_dev == NULL) {
1500 BTA_HhSetProtoMode(p_dev->dev_handle, protocolMode);
1519 btif_hh_device_t *p_dev;
1534 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
1535 if (p_dev == NULL) {
1546 BTA_HhGetReport(p_dev->dev_handle, reportType,
1565 btif_hh_device_t *p_dev;
1579 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
1580 if (p_dev == NULL) {
1595 if (p_dev->p_buf != NULL) {
1596 GKI_freebuf(p_dev->p_buf);
1598 p_dev->p_buf = GKI_getbuf((UINT16) (len + BTA_HH_MIN_OFFSET + sizeof(BT_HDR)));
1599 if (p_dev->p_buf == NULL) {
1604 p_dev->p_buf->len = len;
1605 p_dev->p_buf->offset = BTA_HH_MIN_OFFSET;
1615 pbuf_data = (UINT8*) (p_dev->p_buf + 1) + p_dev->p_buf->offset;
1617 BTA_HhSetReport(p_dev->dev_handle, reportType, p_dev->p_buf);
1637 btif_hh_device_t *p_dev;
1650 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
1651 if (p_dev == NULL) {
1662 if (p_dev->p_buf != NULL) {
1663 GKI_freebuf(p_dev->p_buf);
1665 p_dev->p_buf = GKI_getbuf((UINT16) (len + BTA_HH_MIN_OFFSET + sizeof(BT_HDR)));
1666 if (p_dev->p_buf == NULL) {
1671 p_dev->p_buf->len = len;
1672 p_dev->p_buf->offset = BTA_HH_MIN_OFFSET;
1681 pbuf_data = (UINT8*) (p_dev->p_buf + 1) + p_dev->p_buf->offset;
1683 p_dev->p_buf->layer_specific = BTA_HH_RPTT_OUTPUT;
1684 BTA_HhSendData(p_dev->dev_handle, *bda, p_dev->p_buf);
1705 btif_hh_device_t *p_dev;
1713 p_dev = &btif_hh_cb.devices[i];
1714 if (p_dev->dev_status != BTHH_CONN_STATE_UNKNOWN && p_dev->fd >= 0) {
1715 BTIF_TRACE_DEBUG2("%s: Closing uhid fd = %d", __FUNCTION__, p_dev->fd);
1716 bta_hh_co_destroy(p_dev->fd);
1717 p_dev->fd = -1;
1718 p_dev->hh_keep_polling = 0;
1719 p_dev->hh_poll_thread_id = -1;