Top Description Methods
javax.usb

public Interface UsbPort

Imports
java.util.*

Interface for a USB port.

USB ports belong to a USB hub. In this API, they represent downstream ports. Upstream and (non-declared) internal ports are not represented in this API. Internal ports that are reported as downstream ports by the USB hub (in the USB hub descriptor) are represented.

See the USB 1.1 specification sec 11.16.

Authors
E. Michael Maximilien, Dan Streetman

Method Summary

Modifier and TypeMethod and Description
public byte

Returns:

The number of this port.
getPortNumber
()

Get the number of this port.

public UsbDevice

Returns:

The attached device, or null.
getUsbDevice
()

Get the UsbDevice attached to this UsbPort.

public UsbHub

Returns:

The parent UsbHub.
getUsbHub
()

Get the parent UsbHub.

public boolean

Returns:

If a device is attached to this port.
isUsbDeviceAttached
()

If a device is attached to this port.

Method Detail

getPortNumberback to summary
public byte getPortNumber()

Get the number of this port.

Port numbers are 1-based, not 0-based; see the USB 1.1 specification table 11.8 offset 7. Since the number is 1-based, the first port on a hub has port number 1. There is a maximum of 255 ports on a single hub (so the maximum port number is 255).

This is actually an unsigned byte.

Returns:byte

The number of this port.

getUsbDeviceback to summary
public UsbDevice getUsbDevice()

Get the UsbDevice attached to this UsbPort.

If no UsbDevice is attached, this returns null.

Returns:UsbDevice

The attached device, or null.

getUsbHubback to summary
public UsbHub getUsbHub()

Get the parent UsbHub.

Returns:UsbHub

The parent UsbHub.

isUsbDeviceAttachedback to summary
public boolean isUsbDeviceAttached()

If a device is attached to this port.

Returns:boolean

If a device is attached to this port.