Ports
May 21, 2013, 09:35:04 pm
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: SMF - Just Installed!
Home
Help
Search
Login
Register
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Ports
>
General Category
>
USB
>
Packet Error/Loss on HID
Pages: [
1
]
« previous
next »
Print
Author
Topic: Packet Error/Loss on HID (Read 1988 times)
vanweric
Member
Posts: 24
Packet Error/Loss on HID
«
on:
May 16, 2011, 05:14:42 pm »
I am unclear as to what happens when a packet "on the wire" becomes corrupt. What side(s) are alerted? Is a retry automatically attempted?
I'm specifically interested in HID.
Thank you
- Eric
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1628
Re: Packet Error/Loss on HID
«
Reply #1 on:
May 16, 2011, 07:40:06 pm »
If the CRC value in a token, data, or SOF packet doesn't match, the receiver doesn't return ACK and the sender knows it has to retry. This requires no firmware intervention.
If the data toggle is wrong, the receiver ignores the data and returns ACK to re-synchronize with the sender. Depending on the hardware, this may require firmware control.
Jan
Logged
vanweric
Member
Posts: 24
Re: Packet Error/Loss on HID
«
Reply #2 on:
May 17, 2011, 11:42:33 am »
Thank you Jan!
Does this mean that I can assume a "lossless" link? That is, all packets will either (eventually) arrive intact or error out (e.g. cable is pulled).
I've been told that the windows HID stack is lossy if I don't read my buffers quickly enough. If I can guarantee that I do read fast enough, can the rest of the stack guarantee that packets are lossless and in order?
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1628
Re: Packet Error/Loss on HID
«
Reply #3 on:
May 17, 2011, 11:55:51 am »
The HID driver has a finite buffer. If your application doesn't read reports from the buffer fast enough, the buffer fills and the driver drop the oldest reports to fit new ones.
See:
HidD_SetNumInputBuffers
Yes, the host will retry on receiving corrupt data and will reset the device if major problems occur.
Isochronous transfers have no error correcting but that's not an issue for HIDs.
Jan
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> USB
=> Serial Ports
=> Embedded Ethernet
=> Parallel Port
=> Other Interfaces
=> General Discussion
Loading...