com.ibm.jusb
Class UsbControlPipeImp

java.lang.Object
  extended by com.ibm.jusb.UsbPipeImp
      extended by com.ibm.jusb.UsbControlPipeImp
All Implemented Interfaces:
UsbIrpImp.UsbIrpImpListener, java.util.EventListener, UsbPipe

public class UsbControlPipeImp
extends UsbPipeImp
implements UsbPipe

UsbPipe platform-independent implementation for Control-type pipes.

Author:
Dan Streetman

Field Summary
 
Fields inherited from class com.ibm.jusb.UsbPipeImp
CREATE_SHORT_PACKET_EXCEPTION_POLICY_KEY, PIPE_BULK_QUEUE_POLICY_KEY, PIPE_CONTROL_QUEUE_POLICY_KEY, PIPE_INTERRUPT_QUEUE_POLICY_KEY, PIPE_ISOCHRONOUS_QUEUE_POLICY_KEY
 
Constructor Summary
UsbControlPipeImp()
          Constructor.
UsbControlPipeImp(UsbControlPipeOsImp pipe)
          Constructor.
UsbControlPipeImp(UsbEndpointImp ep)
          Constructor.
UsbControlPipeImp(UsbEndpointImp ep, UsbControlPipeOsImp pipe)
          Constructor.
 
Method Summary
 UsbIrp asyncSubmit(byte[] data)
          Control pipes cannot handle raw byte[] submissions.
 int syncSubmit(byte[] data)
          Control pipes cannot handle raw byte[] submissions.
 
Methods inherited from class com.ibm.jusb.UsbPipeImp
abortAllSubmissions, addUsbPipeListener, asyncSubmit, asyncSubmit, close, createUsbControlIrp, createUsbIrp, getUsbEndpoint, getUsbEndpointImp, getUsbPipeOsImp, isActive, isOpen, open, removeUsbPipeListener, setupUsbIrpImp, setUsbEndpointImp, setUsbPipeOsImp, syncSubmit, syncSubmit, usbIrpImpComplete
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.usb.UsbPipe
abortAllSubmissions, addUsbPipeListener, asyncSubmit, asyncSubmit, close, createUsbControlIrp, createUsbIrp, getUsbEndpoint, isActive, isOpen, open, removeUsbPipeListener, syncSubmit, syncSubmit
 

Constructor Detail

UsbControlPipeImp

public UsbControlPipeImp()
Constructor.


UsbControlPipeImp

public UsbControlPipeImp(UsbEndpointImp ep)
Constructor.

Parameters:
ep - The UsbEndpointImp.

UsbControlPipeImp

public UsbControlPipeImp(UsbControlPipeOsImp pipe)
Constructor.

Parameters:
pipe - The platform-dependent pipe implementation.

UsbControlPipeImp

public UsbControlPipeImp(UsbEndpointImp ep,
                         UsbControlPipeOsImp pipe)
Constructor.

Parameters:
ep - The UsbEndpointImp.
pipe - The platform-dependent pipe implementation.
Method Detail

syncSubmit

public int syncSubmit(byte[] data)
               throws UsbException
Control pipes cannot handle raw byte[] submissions.

Since Control pipes require a setup packet, raw byte[]s are disallowed. This will throw UsbException.

Specified by:
syncSubmit in interface UsbPipe
Overrides:
syncSubmit in class UsbPipeImp
Parameters:
data - The buffer to use.
Returns:
The number of bytes actually transferred.
Throws:
UsbException - Raw byte[]s cannot be used on Control pipes.

asyncSubmit

public UsbIrp asyncSubmit(byte[] data)
                   throws UsbException
Control pipes cannot handle raw byte[] submissions.

Since Control pipes require a setup packet, raw byte[]s are disallowed. This will throw UsbException.

Specified by:
asyncSubmit in interface UsbPipe
Overrides:
asyncSubmit in class UsbPipeImp
Parameters:
data - The buffer to use.
Returns:
A UsbIrp representing the submission.
Throws:
UsbException - Raw byte[]s cannot be used on Control pipes.