Hasan

Hasan

  • NA
  • 76
  • 0

Help Needed regarding HID interfacing

Jul 2 2008 3:19 AM

Hi All,

I am a newcomer in this complex arena of interfacing and using C#. While reading a book regarding this I have got the following things as confusing (for me)-

A call to ReadFile API function doesn’t initiate IN traffic on the bus. It just retrieves a report that the host previously requested in one of it’s periodic IN transfer or if there are no unread reports, waits for next scheduled transfer to complete.

The host begins requesting reports after enumeration when the HID driver is loaded. The driver stores the reports in a ring buffer.

When the buffer is full and a new report arrives the oldest report is overwritten. A call to ReadFile reads the oldest report in the buffer.

The default buffer size is 32 reports and an application can set the buffer size with the HidD_SetNumInputBuffers function. (The maximum size under Windows XP and later is 512)

 

My question is:

> How does host automatically begin requesting report without my ReadFile api call?

> What does it mean- periodic IN transfer? What is that periodic time interval then? Is all this done by the driver?

> How ReadFile can understand that there is no unread report?

 

How Please help me.

 

For your information I am using your win XP and the c# classes you provided in your site recently.

 

waiting for your reply

 

thanks in advance