From 3435bdb66e2ea9d3f2be157702b2d116cc45a25f Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sat, 13 Jul 2013 18:48:32 +0200 Subject: [PATCH] send a full frame containing only zeroes instead of a zero-byte frame --- hmcfgusb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hmcfgusb.c b/hmcfgusb.c index d086419..d8a442f 100644 --- a/hmcfgusb.c +++ b/hmcfgusb.c @@ -146,8 +146,11 @@ int hmcfgusb_send_null_frame(struct hmcfgusb_dev *usbdev, int silent) { int err; int cnt; + unsigned char out[0x40]; - err = libusb_interrupt_transfer(usbdev->usb_devh, EP_OUT, NULL, 0, &cnt, USB_TIMEOUT); + memset(out, 0, sizeof(out)); + + err = libusb_interrupt_transfer(usbdev->usb_devh, EP_OUT, out, sizeof(out), &cnt, USB_TIMEOUT); if (err && (!silent)) { fprintf(stderr, "Can't send null frame: %s\n", usb_strerror(err)); return 0; -- 2.39.5