USB 控制传输是否有 API ?

dengchonglin 2013-08-07 11:06:51
请问一下,我在做PC读写 HID 设备的时候,需要 GET_REPORT 和 SET_REPORT ,
是否在 HID 库中有这个歌函数接口?
...全文
252 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
dengchonglin 2013-09-12
  • 打赏
  • 举报
回复
现在是这样 HID 设备连接到我的设备后,会出现几个设备, 一个 HID 兼容设备。 2 个 人体学输入设备。 SET 和 GET 用的不是同一个 HID 设备的 HANDLE 也就是说 SET 和 GET 打开的设备名不一样~! 这是为什么呢?
dengchonglin 2013-08-08
  • 打赏
  • 举报
回复
谢谢,楼上的, 我现在用 HidD_GetInputReport 返回 0 ,GET error 的代码是 31 HidD_GetFeature HidD_SetFeature HidD_SetOutputReport 的错误代码都是 1 , 不知道什么原因呢~!
of123 2013-08-08
  • 打赏
  • 举报
回复
BOOLEAN __stdcall
HidD_SetOutputReport (
   IN    HANDLE   HidDeviceObject,
   IN    PVOID    ReportBuffer,
   IN    ULONG    ReportBufferLength
   );
/*++
Routine Description:
    Send an output report to a HID device.

Arguments:
    HidDeviceObject      A handle to a Hid Device Object.
 
    ReportBuffer         The buffer of the output report to send to the device
 
    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
                         should be greater than or equal to the 
                         OutputReportByteLength field as specified in the 
                         HIDP_CAPS structure for the device
Return Value:
    TRUE if successful
    FALSE otherwise  -- Use GetLastError() to get extended error information
--*/
dengchonglin 2013-08-07
  • 打赏
  • 举报
回复
自己顶一下, GET_REPORT 可以通过 HidD_GetInputReport 来使用, 但是 GET 产生了, SET 用 HidD_GetInputReport 就不能产生 SET_REPORT 是什么原因呢?

19,523

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧