Reputation: 1457
I am new to HID devices. I am writing a HID driver in windows (similar to vhidmini2). I am a bit confused about APIs used for data movement between the application and the selected device.
What is the difference between:
IOCTL_HID_READ_REPORT
and IOCTL_HID_GET_INPUT_REPORT
/IOCTL_UMDF_HID_GET_INPUT_REPORT
IOCTL_HID_WRITE_REPORT
and IOCTL_HID_SET_OUTPUT_REPORT
/IOCTL_UMDF_HID_SET_OUTPUT_REPORT
ReadFile
and HidD_GetInputReport
WriteFile
and HidD_SetOutputReport
By difference I mean I don't understand when to use which one? As to me, I think all the pairs do the same thing.
Upvotes: 1
Views: 671
Reputation: 54743
HidD_GetInputReport
becomes IOCTL_HID_GET_INPUT_REPORT
.
ReadFile
becomes IOCTL_HID_READ_REPORT
.
HidD_SetOutputReport
becomes IOCTL_HID_SET_OUTPUT_REPORT
.
WriteFile
becomes IOCTL_HID_WRITE_REPORT
.
ReadFile
asks for whatever report happens to come up next. HidD_GetInputReport
asks for one specific report. WriteFile
and HidD_SetOutputReport
are pretty much identical.
Upvotes: 1