javax.usb
Interface UsbHub

All Superinterfaces:
UsbDevice
All Known Implementing Classes:
UsbHubImp, VirtualRootUsbHubImp

public interface UsbHub
extends UsbDevice

Interface for a USB hub.

Author:
Dan Streetman, E. Michael Maximilien

Method Summary
 java.util.List getAttachedUsbDevices()
          Get all attached UsbDevices.
 byte getNumberOfPorts()
          Get the number of (downstream) ports this hub has.
 UsbPort getUsbPort(byte number)
          Get a specific UsbPort by port number.
 java.util.List getUsbPorts()
          Get all the ports this hub has.
 boolean isRootUsbHub()
          If this is the virtual root hub.
 
Methods inherited from interface javax.usb.UsbDevice
addUsbDeviceListener, asyncSubmit, asyncSubmit, containsUsbConfiguration, createUsbControlIrp, getActiveUsbConfiguration, getActiveUsbConfigurationNumber, getManufacturerString, getParentUsbPort, getProductString, getSerialNumberString, getSpeed, getString, getUsbConfiguration, getUsbConfigurations, getUsbDeviceDescriptor, getUsbStringDescriptor, isConfigured, isUsbHub, removeUsbDeviceListener, syncSubmit, syncSubmit
 

Method Detail

getNumberOfPorts

byte getNumberOfPorts()
Get the number of (downstream) ports this hub has.

This is only the number of ports on the hub, not all ports are necessarily enabled, available, usable, or in some cases physically present. This only represents the number of downstream ports the hub claims to have. Note that all hubs have exactly one upstream port, which allows it to connect to the system (or another upstream hub). There is also a internal port which is generally only used by the hub itself. See the USB 1.1 specification sec 11.4 for details on the internal port, sec 11.5 for details on the downstream ports, and sec 11.6 for details on the upstream port.

Returns:
The number of (downstream) ports for this hub.

getUsbPorts

java.util.List getUsbPorts()
Get all the ports this hub has.

The port numbering is 1-based.

The List will be unmodifiable.

Returns:
All ports this hub has.
See Also:
getUsbPort( byte number )

getUsbPort

UsbPort getUsbPort(byte number)
Get a specific UsbPort by port number.

This gets the UsbPort with the specified number. The port numbering is 1-based (not 0-based), and the max port number is 255. See the USB 1.1 specification table 11.8 offset 7.

If the specified port does not exist, this returns null.

Parameters:
number - The number (1-based) of the port to get.
Returns:
The specified port, or null.

getAttachedUsbDevices

java.util.List getAttachedUsbDevices()
Get all attached UsbDevices.

The List will be unmodifiable.

Returns:
All devices currently attached to this hub.

isRootUsbHub

boolean isRootUsbHub()
If this is the virtual root hub.

Returns:
If this is the virtual root hub.