Author Topic: Reading output report from HID  (Read 10735 times)

anthony.carr

  • Member
  • ***
  • Posts: 10
Reading output report from HID
« on: October 25, 2013, 07:32:49 am »
Hi,
I have designed a device that although it is a keyboard, only reports itself as an HID only.
I have downloaded and am running the USBHIDIO visual basic example and I can get key strokes from the unit by clicking the once button.
My question is how do I automatically detect a key stroke from the HID without having to request an output report?
Is there a way of detecting there is an output report pending?
Regards,
TC

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Reading output report from HID
« Reply #1 on: October 25, 2013, 10:25:58 am »
Two clarifications:

Device-to-host communications are IN transfers.

The host driver requests Input reports periodically from the HID. ReadFile and Filestream Reads don't request data from the device; they only retrieve reports in the driver's buffer.

There is no way to detect if an Input report is pending.

My Generic HID example does asynchronous Reads to request data. On retrieving data, you can start another read to make the reads seem "automatic."

Another option would be to edit the report descriptors so the device appears as a system keyboard. If you want your application to read from that keyboard only, use Raw Input.