com.mcreations.usb.windows
Class WindowsPipeOsImp

java.lang.Object
  extended by com.ibm.jusb.os.DefaultUsbPipeOsImp
      extended by com.mcreations.usb.windows.WindowsPipeOsImp
All Implemented Interfaces:
UsbPipeOsImp

public class WindowsPipeOsImp
extends DefaultUsbPipeOsImp
implements UsbPipeOsImp

UsbPipeOsImp implementation for Windows platform.

This must be set up before use.

Author:
Dan Streetman, Kambiz Darabi

Field Summary
protected  byte endpointAddress
           
protected  List inProgressList
           
protected  byte pipeType
           
 
Fields inherited from class com.ibm.jusb.os.DefaultUsbPipeOsImp
allowOpen, HOST_CONTROLLER_OPEN_STRING, HOST_CONTROLLER_SUBMIT_STRING, OPEN_STRING, openString, SUBMIT_STRING, submitString
 
Constructor Summary
WindowsPipeOsImp(UsbPipeImp pipe, com.mcreations.usb.windows.WindowsInterfaceOsImp iface)
          Constructor
 
Method Summary
 void asyncSubmit(UsbIrpImp irp)
          Delegates to the WindowsDeviceOsImp of this pipe.
 void close()
          Close this pipe.
protected  byte getEndpointAddress()
           
protected  byte getPipeType()
           
 UsbPipeImp getUsbPipeImp()
           
 com.mcreations.usb.windows.WindowsInterfaceOsImp getWindowsInterfaceOsImp()
           
 void open()
          Opens the corresponding device of this pipe to get a libusb device handle.
 void setUsbPipeImp(UsbPipeImp pipe)
           
 void setWindowsInterfaceOsImp(com.mcreations.usb.windows.WindowsInterfaceOsImp iface)
           
 void syncSubmit(UsbIrpImp irp)
          Synchronously submits this UsbIrpImp to the platform implementation.
 
Methods inherited from class com.ibm.jusb.os.DefaultUsbPipeOsImp
abortAllSubmissions, allowOpen, asyncSubmit, getOpenString, getSubmitString, syncSubmit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.jusb.os.UsbPipeOsImp
abortAllSubmissions, asyncSubmit, syncSubmit
 

Field Detail

pipeType

protected byte pipeType

endpointAddress

protected byte endpointAddress

inProgressList

protected List inProgressList
Constructor Detail

WindowsPipeOsImp

public WindowsPipeOsImp(UsbPipeImp pipe,
                        com.mcreations.usb.windows.WindowsInterfaceOsImp iface)
Constructor

Method Detail

getUsbPipeImp

public UsbPipeImp getUsbPipeImp()
Returns:
The UsbPipeImp for this

setUsbPipeImp

public void setUsbPipeImp(UsbPipeImp pipe)
Parameters:
usbPipeImp - The UsbPipeImp for this

getWindowsInterfaceOsImp

public com.mcreations.usb.windows.WindowsInterfaceOsImp getWindowsInterfaceOsImp()
Returns:
The WindowsInterfaceOsImp

setWindowsInterfaceOsImp

public void setWindowsInterfaceOsImp(com.mcreations.usb.windows.WindowsInterfaceOsImp iface)
Parameters:
iface - The WindowsInterfaceOsImp

getEndpointAddress

protected byte getEndpointAddress()
Returns:
The endpoint address

getPipeType

protected byte getPipeType()
Returns:
The pipe type

open

public void open()
          throws UsbException
Opens the corresponding device of this pipe to get a libusb device handle.

Specified by:
open in interface UsbPipeOsImp
Overrides:
open in class DefaultUsbPipeOsImp
Throws:
UsbException - If allowOpen is false.
See Also:
UsbPipeOsImp.open()

close

public void close()
Description copied from class: DefaultUsbPipeOsImp
Close this pipe.

By default, this does nothing. The implementation can override this method if appropriate.

Specified by:
close in interface UsbPipeOsImp
Overrides:
close in class DefaultUsbPipeOsImp
See Also:
UsbPipeOsImp.close()

asyncSubmit

public void asyncSubmit(UsbIrpImp irp)
                 throws UsbException
Delegates to the WindowsDeviceOsImp of this pipe.

Specified by:
asyncSubmit in interface UsbPipeOsImp
Overrides:
asyncSubmit in class DefaultUsbPipeOsImp
Parameters:
irp - the UsbIrpImp to use for this submission.
Throws:
UsbException - If the UsbIrpImp was not accepted by the implementation.
See Also:
UsbPipeOsImp.asyncSubmit(com.ibm.jusb.UsbIrpImp)

syncSubmit

public void syncSubmit(UsbIrpImp irp)
                throws UsbException
Description copied from class: DefaultUsbPipeOsImp
Synchronously submits this UsbIrpImp to the platform implementation.

This is implemented using asyncSubmit(UsbIrpImp).

Specified by:
syncSubmit in interface UsbPipeOsImp
Overrides:
syncSubmit in class DefaultUsbPipeOsImp
Parameters:
irp - the UsbIrpImp to use for this submission.
Throws:
UsbException - If the data transfer was unsuccessful.


Copyright © 2012 LSST. All Rights Reserved.