com.ibm.jusb
Class UsbEndpointImp

java.lang.Object
  extended by com.ibm.jusb.UsbEndpointImp
All Implemented Interfaces:
UsbEndpoint

public class UsbEndpointImp
extends java.lang.Object
implements UsbEndpoint

UsbEndpoint implementation.

This must be set up before use.

Author:
Dan Streetman

Constructor Summary
UsbEndpointImp(UsbInterfaceImp iface, UsbEndpointDescriptor desc)
          Constructor.
 
Method Summary
 byte getDirection()
          Get this endpoint's direction.
 byte getType()
          Get this endpoint's type.
 UsbEndpointDescriptor getUsbEndpointDescriptor()
          Get the descriptor for this UsbEndpoint.
 UsbInterface getUsbInterface()
          Get the parent UsbInterface that this UsbEndpoint belongs to.
 UsbInterfaceImp getUsbInterfaceImp()
           
 UsbPipe getUsbPipe()
          Get the UsbPipe for this UsbEndpoint.
 UsbPipeImp getUsbPipeImp()
           
 void setUsbEndpointDescriptor(UsbEndpointDescriptor desc)
           
 void setUsbInterfaceImp(UsbInterfaceImp iface)
          Set the UsbInterfaceImp.
 void setUsbPipeImp(UsbPipeImp pipe)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsbEndpointImp

public UsbEndpointImp(UsbInterfaceImp iface,
                      UsbEndpointDescriptor desc)
Constructor.

Parameters:
iface - The parent interface.
desc - This endpoint's descriptor.
Method Detail

getDirection

public byte getDirection()
Description copied from interface: UsbEndpoint
Get this endpoint's direction.

This is the logical AND of the direction mask and the endpoint descriptor's address.

Specified by:
getDirection in interface UsbEndpoint
Returns:
direction of this endpoint (i.e. in [from device to host] or out [from host to device])
See Also:
UsbConst.ENDPOINT_DIRECTION_IN, UsbConst.ENDPOINT_DIRECTION_OUT

getType

public byte getType()
Description copied from interface: UsbEndpoint
Get this endpoint's type.

This is the logical AND of the type mask and the endpoint descriptor's attributes.

Specified by:
getType in interface UsbEndpoint
Returns:
this endpoint's type
See Also:
UsbConst.ENDPOINT_TYPE_CONTROL, UsbConst.ENDPOINT_TYPE_BULK, UsbConst.ENDPOINT_TYPE_INTERRUPT, UsbConst.ENDPOINT_TYPE_ISOCHRONOUS

getUsbInterface

public UsbInterface getUsbInterface()
Description copied from interface: UsbEndpoint
Get the parent UsbInterface that this UsbEndpoint belongs to.

Specified by:
getUsbInterface in interface UsbEndpoint
Returns:
The UsbInterface

getUsbInterfaceImp

public UsbInterfaceImp getUsbInterfaceImp()
Returns:
The UsbInterfaceImp

setUsbInterfaceImp

public void setUsbInterfaceImp(UsbInterfaceImp iface)
Set the UsbInterfaceImp.

This will also add this to the parent UsbInterfaceImp.

Parameters:
iface - The interface

getUsbPipe

public UsbPipe getUsbPipe()
Description copied from interface: UsbEndpoint
Get the UsbPipe for this UsbEndpoint.

This is the only method of communication to this endpoint.

Specified by:
getUsbPipe in interface UsbEndpoint
Returns:
The UsbPipe

getUsbPipeImp

public UsbPipeImp getUsbPipeImp()
Returns:
The UsbPipeImp

setUsbPipeImp

public void setUsbPipeImp(UsbPipeImp pipe)
Parameters:
pipe - The pipe

getUsbEndpointDescriptor

public UsbEndpointDescriptor getUsbEndpointDescriptor()
Description copied from interface: UsbEndpoint
Get the descriptor for this UsbEndpoint.

The descriptor may be cached.

Specified by:
getUsbEndpointDescriptor in interface UsbEndpoint
Returns:
the endpoint descriptor for this endpoint

setUsbEndpointDescriptor

public void setUsbEndpointDescriptor(UsbEndpointDescriptor desc)
Parameters:
desc - the endpoint descriptor