Skip to content

Commit

Permalink
Fix zero length packet handling (#73)
Browse files Browse the repository at this point in the history
This fixes zero length packet handling.
See the following example that requests 128 bytes:

```
SETUP(8)
IN(64)
IN(64)
STATUS(0)
```

The current code erroneously assumes that there are no more IN packets
after the first two 64-byte packets.

However, what happens with the following:

```
SETUP(8)
IN(64)
IN(64)
IN(64)    <--- current code assumes this will be, and expects a STATUS packet
STATUS(0)
```

Currently, the third IN(64) above will result in a coding error because
the code is expecting the STATUS packet, not another IN packet.

The "controller" must allow for more packets than expected, returning a
short packet detect on the third IN(64) packet shown above, actually
returning zero bytes, hence the Short Packet Detect.

This patch was tested on WinXP, Win7, and Win10.
  • Loading branch information
fysnet authored Sep 7, 2023
1 parent 0d48349 commit 43dd416
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 142 deletions.
Loading

0 comments on commit 43dd416

Please sign in to comment.