com.ibm.jusb.os
Class DefaultUsbControlPipeOsImp

java.lang.Object
  extended by com.ibm.jusb.os.DefaultUsbPipeOsImp
      extended by com.ibm.jusb.os.DefaultUsbControlPipeOsImp
All Implemented Interfaces:
UsbControlPipeOsImp, UsbPipeOsImp

public class DefaultUsbControlPipeOsImp
extends DefaultUsbPipeOsImp
implements UsbControlPipeOsImp

Default implementation for UsbControlPipeOsImp.

This is identical to DefaultUsbPipeOsImp except all the methods require UsbControlIrpImps, not UsbIrpImps. This should be driven by a UsbControlPipeImp, not a normal UsbPipeImp.

Author:
Dan Streetman

Field Summary
 
Fields inherited from class com.ibm.jusb.os.DefaultUsbPipeOsImp
HOST_CONTROLLER_OPEN_STRING, HOST_CONTROLLER_SUBMIT_STRING, OPEN_STRING, SUBMIT_STRING
 
Constructor Summary
DefaultUsbControlPipeOsImp()
          Constructor.
DefaultUsbControlPipeOsImp(boolean open)
          Constructor.
DefaultUsbControlPipeOsImp(java.lang.String open, java.lang.String submit)
          Constructor.
 
Method Summary
 void asyncSubmit(UsbControlIrpImp irp)
          Asynchronously submits this UsbControlIrpImp to the platform implementation.
 void asyncSubmit(UsbIrpImp irp)
          Asynchronously submits this UsbIrpImp to the platform implementation.
 void syncSubmit(UsbControlIrpImp irp)
          Synchronously submits this UsbControlIrpImp to the platform implementation.
 void syncSubmit(UsbIrpImp irp)
          Synchronously submit a UsbControlIrpImp.
 
Methods inherited from class com.ibm.jusb.os.DefaultUsbPipeOsImp
abortAllSubmissions, asyncSubmit, close, open, syncSubmit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.jusb.os.UsbPipeOsImp
abortAllSubmissions, asyncSubmit, close, open, syncSubmit
 

Constructor Detail

DefaultUsbControlPipeOsImp

public DefaultUsbControlPipeOsImp()
Constructor.


DefaultUsbControlPipeOsImp

public DefaultUsbControlPipeOsImp(java.lang.String open,
                                  java.lang.String submit)
Constructor.

Parameters:
open - The String to use in UsbExceptions thrown in open().
submit - The String to use in UsbExceptions thrown in submit methods.

DefaultUsbControlPipeOsImp

public DefaultUsbControlPipeOsImp(boolean open)
Constructor.

If this is true, opening is allowed.

Parameters:
open - If this should allow opening.
Method Detail

syncSubmit

public void syncSubmit(UsbIrpImp irp)
                throws UsbException,
                       java.lang.ClassCastException
Synchronously submit a UsbControlIrpImp.

This casts the UsbIrpImp to a UsbControlIrpImp and uses the syncSubmit(UsbControlIrpImp) method.

Specified by:
syncSubmit in interface UsbPipeOsImp
Overrides:
syncSubmit in class DefaultUsbPipeOsImp
Parameters:
irp - The UsbControlIrpImp to submit.
Throws:
UsbException - If syncSubmit(UsbControlIrpImp) throws a UsbException.
java.lang.ClassCastException

asyncSubmit

public void asyncSubmit(UsbIrpImp irp)
                 throws UsbException,
                        java.lang.ClassCastException
Asynchronously submits this UsbIrpImp to the platform implementation.

This casts the UsbIrpImp to a UsbControlIrpImp and uses the asyncSubmit(UsbControlIrpImp) method.

Specified by:
asyncSubmit in interface UsbPipeOsImp
Overrides:
asyncSubmit in class DefaultUsbPipeOsImp
Parameters:
irp - The UsbControlIrpImp to submit.
Throws:
UsbException - If asyncSubmit(UsbControlIrpImp) throws a UsbException.
java.lang.ClassCastException

syncSubmit

public void syncSubmit(UsbControlIrpImp irp)
                throws UsbException
Synchronously submits this UsbControlIrpImp to the platform implementation.

This uses asyncSubmit(UsbControlIrpImp).

Specified by:
syncSubmit in interface UsbControlPipeOsImp
Parameters:
irp - the UsbControlIrpImp to use for this submission.
Throws:
UsbException - If the data transfer was unsuccessful.

asyncSubmit

public void asyncSubmit(UsbControlIrpImp irp)
                 throws UsbException
Asynchronously submits this UsbControlIrpImp to the platform implementation.

By default, this throws UsbException with the String defined by getSubmitString. The implementation should override (at least) this method.

Specified by:
asyncSubmit in interface UsbControlPipeOsImp
Parameters:
irp - the UsbControlIrpImp to use for this submission.
Throws:
UsbException - If the initial submission was unsuccessful.