From a19ac0f65490cec94ecb9b15ed9a3eea020a9dcc Mon Sep 17 00:00:00 2001 From: Sebastian Zagrodzki Date: Wed, 8 Feb 2017 22:35:45 +0100 Subject: [PATCH] Per http://www.beyondlogic.org/usbnutshell/usb5.shtml#EndpointDescriptors: bits 0-3 are endpoint number, 4-6 reserved, set to zero, bit 7 is direction. Bits 0-3 is 0x0f. --- usb/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/constants.go b/usb/constants.go index b4dc590..88a28b7 100644 --- a/usb/constants.go +++ b/usb/constants.go @@ -87,7 +87,7 @@ func (dt DescriptorType) String() string { type EndpointDirection uint8 const ( - ENDPOINT_NUM_MASK = 0x03 + ENDPOINT_NUM_MASK = 0x0f ENDPOINT_DIR_IN EndpointDirection = C.LIBUSB_ENDPOINT_IN ENDPOINT_DIR_OUT EndpointDirection = C.LIBUSB_ENDPOINT_OUT ENDPOINT_DIR_MASK EndpointDirection = 0x80