Skip to content

Commit

Permalink
handle error case on USB 3.0: control transfer may return 512 bytes
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Echtler <[email protected]>
  • Loading branch information
floe authored and zarvox committed Dec 9, 2012
1 parent 55451aa commit d1d19df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cameras.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,8 @@ static int send_cmd(freenect_device *dev, uint16_t cmd, void *cmdbuf, unsigned i

do {
actual_len = fnusb_control(&dev->usb_cam, 0xc0, 0, 0, 0, ibuf, 0x200);
} while (actual_len == 0);
FN_FLOOD("actual_len: %d\n", actual_len);
} while ((actual_len == 0) || (actual_len == 0x200));
FN_SPEW("Control reply: %d\n", res);
if (actual_len < (int)sizeof(*rhdr)) {
FN_ERROR("send_cmd: Input control transfer failed (%d)\n", res);
Expand Down

0 comments on commit d1d19df

Please sign in to comment.