File: Usb_Descriptor.java

package info (click to toggle)
libusb-java 0.8%2Bztex20090101-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 416 kB
  • ctags: 810
  • sloc: java: 1,102; ansic: 605; makefile: 98; sh: 29
file content (59 lines) | stat: -rw-r--r-- 1,298 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* 
 * Java libusb wrapper
 * Copyright (c) 2005-2006 Andreas Schlaepfer <spandi at users.sourceforge.net>
 *
 * http://libusbjava.sourceforge.net
 * This library is covered by the LGPL, read LGPL.txt for details.
 */
package ch.ntb.usb;

/**
 * Common USB descriptor values.<br>
 * 
 */
public class Usb_Descriptor {

	/**
	 * Descriptor types.
	 */
	public static final int USB_DT_DEVICE = 0x01, USB_DT_CONFIG = 0x02,
			USB_DT_STRING = 0x03, USB_DT_INTERFACE = 0x04,
			USB_DT_ENDPOINT = 0x05;

	/**
	 * Descriptor types.
	 */
	public static final int USB_DT_HID = 0x21, USB_DT_REPORT = 0x22,
			USB_DT_PHYSICAL = 0x23, USB_DT_HUB = 0x29;

	/**
	 * Descriptor sizes per descriptor type.
	 */
	public static final int USB_DT_DEVICE_SIZE = 18, USB_DT_CONFIG_SIZE = 9,
			USB_DT_INTERFACE_SIZE = 9, USB_DT_ENDPOINT_SIZE = 7,
			USB_DT_ENDPOINT_AUDIO_SIZE = 9 /* Audio extension */,
			USB_DT_HUB_NONVAR_SIZE = 7;

	private byte bLength;

	private byte bDescriptorType;

	/**
	 * Get the type of this descriptor.<br>
	 * 
	 * @return the type of this descriptor
	 */
	public byte getBDescriptorType() {
		return bDescriptorType;
	}

	/**
	 * Get the size of this descriptor in bytes.<br>
	 * 
	 * @return the size of this descriptor in bytes
	 */
	public byte getBLength() {
		return bLength;
	}

}