Skip to content

Commit d1d19df

Browse files
floezarvox
authored andcommitted
handle error case on USB 3.0: control transfer may return 512 bytes
Signed-off-by: Florian Echtler <[email protected]>
1 parent 55451aa commit d1d19df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cameras.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ static int send_cmd(freenect_device *dev, uint16_t cmd, void *cmdbuf, unsigned i
688688

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

0 commit comments

Comments
 (0)