社区
网络及通讯开发
帖子详情
USB HID设备数据读取
u010423818
2016-10-14 06:15:01
罗技科技的G29游戏方向盘的数据接口为USB类型的,是否可以通过VC++将操作员操作G29游戏用方向盘的方向盘转角,加速踏板、制动踏板、离合器踏板行程或负荷率等信息,档位信息采集出来。如果可以,请问采集信息操作步骤大致是怎样的。
本人没用过G29游戏用方向盘,求科普。
...全文
1599
回复
打赏
收藏
USB HID设备数据读取
罗技科技的G29游戏方向盘的数据接口为USB类型的,是否可以通过VC++将操作员操作G29游戏用方向盘的方向盘转角,加速踏板、制动踏板、离合器踏板行程或负荷率等信息,档位信息采集出来。如果可以,请问采集信息操作步骤大致是怎样的。 本人没用过G29游戏用方向盘,求科普。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
usb
hid
数据
读取
usb
hid
数据
读取
完整的demo
C#
读取
USB
HID
设备
这是用C#写的
读取
USB
HID
设备
的测试软件,输入VID、PIV,查找
HID
设备
是否存在,如果存在,则
读取
指定的
HID
设备
发来的
数据
。软件已测试,可以直接使用。(不可
读取
键盘、鼠标),只能
读取
自定义
HID
设备
。
C++实现
USB
HID
设备
读写代码
C++实现
USB
HID
设备
读写代码,通过C++语言来实现
读取
usb
接口
设备
的
数据
读写。
qt 通过
hid
获取指定
usb
设备
并
读取
数据
文件夹中包含
hid
api.h
hid
api.dll
hid
api.lib,我是在windows10系统中用VS2013编译的release版本,我用于qt的调用,是可以实现的。 调用过程: int res; res =
hid
_init(); wchar_t wstr[MAX_STR]; int i; // Open the device using the VID, PID, // and optionally the Serial number. handle =
hid
_open(0x0483, 0x5750, NULL); if(handle == NULL) { qDebug() << "NULL-----------------------NULL" ; return; } else { qDebug() << " not ------------NULL-----------------------NULL" ; } // Read the Manufacturer String res =
hid
_get_manufacturer_string(handle, wstr, MAX_STR); wprintf(L"Manufacturer String: %s\n", wstr); // Read the Product String res =
hid
_get_product_string(handle, wstr, MAX_STR); wprintf(L"Product String: %s\n", wstr); // Read the Serial Number String res =
hid
_get_serial_number_string(handle, wstr, MAX_STR); wprintf(L"Serial Number String: (%d) %s\n", wstr[0], wstr); // Read Indexed String 1 res =
hid
_get_indexed_string(handle, 1, wstr, MAX_STR); wprintf(L"Indexed String 1: %s\n", wstr); qDebug("
hid
read start"); int res =
hid
_set_nonblocking(handle, 0); while (1) { res =
hid
_read(handle,buf,sizeof(buf)); QString asd ; for(int i = 0;i < sizeof(buf);i++) { char str[20]; sprintf(str , "%02x",buf[i]); asd+=str ; } if(!cardInfo.contains(asd.toUpper())) { cardInfo.append(asd.toUpper() ); for(int i = 0;i < cardInfo.size() ;i++) { dealWithData( cardInfo[i]); } } }
基于MFC编写的读写
USB
_
HID
设备
数据
程序(供参考学习)
本文档给了一个基于MFC来编写读写
USB
-
HID
设备
数据
的参考程序,详细介绍了编写思路,从宏观的角度实现了
HID
枚举成的
设备
与PC机建立通信的过程,大家可以参考学习。
网络及通讯开发
1,317
社区成员
8,874
社区内容
发帖
与我相关
我的任务
网络及通讯开发
C++ Builder 网络及通讯开发
复制链接
扫一扫
分享
社区描述
C++ Builder 网络及通讯开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章