This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Win HID ReadFile

Hi out there,

i've encountered a strange situation while trying some HID stuff. When a in report is issued i can see the full report on the bus. The hostapp using ReadFile() and Marshal.Copy() only gets the first 64 bytes.

any clue?

Thanks

Parents
  • ReadFile takes buffer and its size as its parameters,

    ReadFile( , lpBuffer, nNumberOfBytesToRead, ... )

    This size should be greater than the report size by (at least) one byte, for report ID.
    The first byte on the returned buffer is report ID. The report body follows after it.
    0 (default report ID: 1 byte) - report body.

    If you define any report ID on the device report descriptor, above report ID field matches to this defined report ID.

    If you define two or more input reports on the report descriptor, always pass the greatest size of the report (and report ID) to ReadFile. It's because, host app doesn't know which report comes next.

    Tsuneo

Reply
  • ReadFile takes buffer and its size as its parameters,

    ReadFile( , lpBuffer, nNumberOfBytesToRead, ... )

    This size should be greater than the report size by (at least) one byte, for report ID.
    The first byte on the returned buffer is report ID. The report body follows after it.
    0 (default report ID: 1 byte) - report body.

    If you define any report ID on the device report descriptor, above report ID field matches to this defined report ID.

    If you define two or more input reports on the report descriptor, always pass the greatest size of the report (and report ID) to ReadFile. It's because, host app doesn't know which report comes next.

    Tsuneo

Children
No data