Android Open Source - USBIPServerForAndroid Usb Device Descriptor






From Project

Back to project page USBIPServerForAndroid.

License

The source code is released under:

GNU General Public License

If you think the Android project USBIPServerForAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.cgutman.usbip.usb;
// w ww  .j  a  v  a2  s  . co m
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class UsbDeviceDescriptor {

  public byte bLength;
  public byte bDescriptorType;
  public short bcdUSB;
  public byte bDeviceClass;
  public byte bDeviceSubClass;
  public byte bDeviceProtocol;
  public byte bMaxPacketSize;
  public short idVendor;
  public short idProduct;
  public short bcdDevice;
  public byte iManufacturer;
  public byte iProduct;
  public byte iSerialNumber;
  public byte bNumConfigurations;
  
  public static final int DESCRIPTOR_SIZE = 18;

  public UsbDeviceDescriptor(byte[] data) {
    ByteBuffer bb = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN);
    bLength = bb.get();
    bDescriptorType = bb.get();
    bcdUSB = bb.getShort();
    bDeviceClass = bb.get();
    bDeviceSubClass = bb.get();
    bDeviceProtocol = bb.get();
    bMaxPacketSize = bb.get();
    idVendor = bb.getShort();
    idProduct = bb.getShort();
    bcdDevice = bb.getShort();
    iManufacturer = bb.get();
    iProduct = bb.get();
    iSerialNumber = bb.get();
    bNumConfigurations = bb.get();
  }
}




Java Source Code List

org.cgutman.usbip.config.UsbIpConfig.java
org.cgutman.usbip.errno.Errno.java
org.cgutman.usbip.server.UsbDeviceInfo.java
org.cgutman.usbip.server.UsbIpServer.java
org.cgutman.usbip.server.UsbRequestHandler.java
org.cgutman.usbip.server.protocol.ProtoDefs.java
org.cgutman.usbip.server.protocol.UsbIpDevice.java
org.cgutman.usbip.server.protocol.UsbIpInterface.java
org.cgutman.usbip.server.protocol.cli.CommonPacket.java
org.cgutman.usbip.server.protocol.cli.DevListReply.java
org.cgutman.usbip.server.protocol.cli.DevListRequest.java
org.cgutman.usbip.server.protocol.cli.ImportDeviceReply.java
org.cgutman.usbip.server.protocol.cli.ImportDeviceRequest.java
org.cgutman.usbip.server.protocol.dev.UsbIpDevicePacket.java
org.cgutman.usbip.server.protocol.dev.UsbIpSubmitUrbReply.java
org.cgutman.usbip.server.protocol.dev.UsbIpSubmitUrb.java
org.cgutman.usbip.server.protocol.dev.UsbIpUnlinkUrbReply.java
org.cgutman.usbip.server.protocol.dev.UsbIpUnlinkUrb.java
org.cgutman.usbip.service.UsbIpService.java
org.cgutman.usbip.usb.UsbControlHelper.java
org.cgutman.usbip.usb.UsbDeviceDescriptor.java
org.cgutman.usbip.usb.XferUtils.java
org.cgutman.usbip.utils.StreamUtils.java