getEndpoint(index); // MyLog.e(" i:" + i + " :" + connectionState + " j:" + index + ":" + point.toString() + " type:" + point.getType() + " :" + point.getDirection()); //判断UsbEndpoint的类型,也即是type。这种类型的UsbDevice使用USB_ENDPOINT_XFER_BULK这种类型的Usb...
dev->bulk_in_endpointAddr && (endpoint->bEndpointAddress & USB_DIR_IN) && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK)) { /*找到一个批量IN端点*/ buffer_size = endpoint->wMaxPacketSize; dev->bulk_in_size = buffer_size; dev->bulk_in_endpointAddr...
bEndpointAddress,特定端点的USB地址。还包含了端点的方向。可以结合位掩码USB_DIR_OUT和USB_DIR_IN,以确定该端点的数据是传向设备还是主机。 bmAttributes,端点的类型。结合位掩码USB_ENDPOINT_XFERTYPE_MASK,以确定此端点的类型是USB_ENDPOINT_XFER_ISOC(等时)、USB_ENDPOINT_XFER_BULK(批量)还是USB_ENDPOINT_XFER_...
#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* bmAttributes 的位掩码*/ #define USB_ENDPOINT_XFER_CONTROL 0 #define USB_ENDPOINT_XFER_ISOC 1 #define USB_ENDPOINT_XFER_BULK 2 #define USB_ENDPOINT_XFER_INT 3 #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 /*---*/ USB 和 sysfs 由于单个 USB 物理设...
if (point.getType() == UsbConstants.USB_ENDPOINT_XFER_BULK) { if (point.getDirection() == UsbConstants.USB_DIR_IN) { usbEndpointIn = point; } else if (point.getDirection() == UsbConstants.USB_DIR_OUT) { usbEndpointOut = point; ...
UsbEndpointendpointOut=null;for(inti=0;i<usbInterface.getEndpointCount();i++){UsbEndpointendpoint=usbInterface.getEndpoint(i);if(endpoint.getType()==UsbConstants.USB_ENDPOINT_XFER_BULK){if(endpoint.getDirection()==UsbConstants.USB_DIR_IN){endpointIn=endpoint;}elseif(endpoint.getDirection()==...
for(int index=0;index<usbInterface.getEndpointCount();index++){UsbEndpoint point=usbInterface.getEndpoint(index);if(point.getType()==UsbConstants.USB_ENDPOINT_XFER_BULK){if(point.getDirection()==UsbConstants.USB_DIR_IN){usbEndpointIn=point;}elseif(point.getDirection()==UsbConstants.USB_DIR_...
a -- bEndpointAddress(b for byte) 8位端点地址,其地址还隐藏了端点方向的信息(之前说过,端点是单向的),可以用掩码USB_DIR_OUT和USB_DIR_IN来确定。 b -- bmAttributes 端点的类型,结合USB_ENDPOINT_XFERTYPE_MASK可以确定端点是USB_ENDPOINT_XFER_ISOC(等时)、USB_ENDPOINT_XFER_BULK(批量)还是USB_ENDPOINT...
.bmAttributes = USB_ENDPOINT_XFER_BULK,.wMaxPacketSize = cpu_to_le16(512),};static struct usb_endpoint_descriptor hs_bulk_out_desc = {.bLength = USB_DT_ENDPOINT_SIZE,.bDescriptorType = USB_DT_ENDPOINT,.bEndpointAddress = USB_DIR_OUT,.bmAttributes = USB_ENDPOINT_XFER_BULK,.wMaxPacket...
if (point.getType() == UsbConstants.USB_ENDPOINT_XFER_BULK) { if (point.getDirection() == UsbConstants.USB_DIR_IN) { usbEndpointIn = point; } else if (point.getDirection() == UsbConstants.USB_DIR_OUT) { usbEndpointOut = point; ...