usb.core
Interface Bus

All Known Subinterfaces:
RemoteBus

public interface Bus

A Universal Serial Bus connects a set of (USB) devices to a Host. Such buses are largely autoconfiguring. Aspects such as power management, driver binding, and device configuration involve policy choices, typically made in cooperation between the host OS kernel and user-mode software such as applications or services for them.

The bus can be examined device by device. Because devices can be inserted and removed at any time, there is no notion of a self-consistent listing snapshot in this API. Rather than scanning the bus, instead use addUSBListener with an object that can immediately react to device addition or removal, or directly walk the tree of USB devices.


Method Summary
 java.lang.String getBusId()
          Returns a host-specific stable identifier for this bus.
 Device getDevice(int address)
          Returns an object representing the device with the specified address (1 through 127), or null if no such device exists.
 Host getHost()
          Returns the USB host to which this bus is connected.
 Device getRootHub()
          Returns the root hub of the bus, if it is known yet.
 

Method Detail

getHost

public Host getHost()
             throws java.io.IOException
Returns the USB host to which this bus is connected.

getRootHub

public Device getRootHub()
                  throws java.io.IOException
Returns the root hub of the bus, if it is known yet.

getDevice

public Device getDevice(int address)
                 throws java.io.IOException
Returns an object representing the device with the specified address (1 through 127), or null if no such device exists.
See Also:
Device.getAddress()

getBusId

public java.lang.String getBusId()
                          throws java.io.IOException
Returns a host-specific stable identifier for this bus. An example would be the PCI slot name for its controller, but other identifiers can be used too. The identifier is expected to be stable across host OS reboots. These identifiers do not have slashes or dashes ("/", "-").


Associated source code is licenced under the LGPL.
See http://jusb.sourceforge.net
This documentation was derived from that source code on 24-Jul-2002.