OpenCores
URL https://opencores.org/ocsvn/usb_fpga_2_13/usb_fpga_2_13/trunk

Subversion Repositories usb_fpga_2_13

[/] [usb_fpga_2_13/] [trunk/] [libusbJava-src/] [ch/] [ntb/] [usb/] [Usb_Device.java] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
/*
2
 * Java libusb wrapper
3
 * Copyright (c) 2005-2006 Andreas Schläpfer <spandi at users.sourceforge.net>
4
 *
5
 * http://libusbjava.sourceforge.net
6
 * This library is covered by the LGPL, read LGPL.txt for details.
7
 */
8
package ch.ntb.usb;
9
 
10
/**
11
 * Represents an USB device.<br>
12
 * An USB device has one device descriptor and it may have multiple
13
 * configuration descriptors.
14
 *
15
 */
16
public class Usb_Device {
17
 
18
        private Usb_Device next, prev;
19
 
20
        private String filename;
21
 
22
        private Usb_Bus bus;
23
 
24
        private Usb_Device_Descriptor descriptor;
25
 
26
        private Usb_Config_Descriptor[] config;
27
 
28
        private byte devnum;
29
 
30
        private byte num_children;
31
 
32
        private Usb_Device children;
33
 
34
        /**
35
         * The address of the device structure to be passed to usb_open. This value
36
         * is used only internally so we don't use getter or setter methods.
37
         */
38
        @SuppressWarnings("unused")
39
        private long devStructAddr;
40
 
41
        /**
42
         * Returns the reference to the bus to which this device is connected.<br>
43
         *
44
         * @return the reference to the bus to which this device is connected
45
         */
46
        public Usb_Bus getBus() {
47
                return bus;
48
        }
49
 
50
        /**
51
         * Returns a reference to the first child.<br>
52
         *
53
         * @return a reference to the first child
54
         */
55
        public Usb_Device getChildren() {
56
                return children;
57
        }
58
 
59
        /**
60
         * Returns the USB config descriptors.<br>
61
         *
62
         * @return the USB config descriptors
63
         */
64
        public Usb_Config_Descriptor[] getConfig() {
65
                return config;
66
        }
67
 
68
        /**
69
         * Returns the USB device descriptor.<br>
70
         *
71
         * @return the USB device descriptor
72
         */
73
        public Usb_Device_Descriptor getDescriptor() {
74
                return descriptor;
75
        }
76
 
77
        /**
78
         * Returns the number assigned to this device.<br>
79
         *
80
         * @return the number assigned to this device
81
         */
82
        public byte getDevnum() {
83
                return devnum;
84
        }
85
 
86
        /**
87
         * Returns the systems String representation.<br>
88
         *
89
         * @return the systems String representation
90
         */
91
        public String getFilename() {
92
                return filename;
93
        }
94
 
95
        /**
96
         * Returns the pointer to the next device.<br>
97
         *
98
         * @return the pointer to the next device or null
99
         */
100
        public Usb_Device getNext() {
101
                return next;
102
        }
103
 
104
        /**
105
         * Returns the number of children of this device.<br>
106
         *
107
         * @return the number of children of this device
108
         */
109
        public byte getNumChildren() {
110
                return num_children;
111
        }
112
 
113
        /**
114
         * Returns the pointer to the previous device.<br>
115
         *
116
         * @return the pointer to the previous device or null
117
         */
118
        public Usb_Device getPrev() {
119
                return prev;
120
        }
121
 
122
        @Override
123
        public String toString() {
124
                return "Usb_Device " + filename;
125
        }
126
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.