|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.jusb.UsbPipeImp
public class UsbPipeImp
UsbPipe platform-independent implementation.
This must be set up before use.
UsbEndpointImp
must be set either in the
constructor or by its setter
.UsbPipeOsImp
may optionally be set either in the
constructor or by its setter
.
If not set, it defaults to a DefaultUsbPipeOsImp
.
Field Summary | |
---|---|
static java.lang.String |
CREATE_SHORT_PACKET_EXCEPTION_POLICY_KEY
|
static java.lang.String |
PIPE_BULK_QUEUE_POLICY_KEY
|
static java.lang.String |
PIPE_CONTROL_QUEUE_POLICY_KEY
|
static java.lang.String |
PIPE_INTERRUPT_QUEUE_POLICY_KEY
|
static java.lang.String |
PIPE_ISOCHRONOUS_QUEUE_POLICY_KEY
|
Constructor Summary | |
---|---|
UsbPipeImp()
Constructor. |
|
UsbPipeImp(UsbEndpointImp ep)
Constructor. |
|
UsbPipeImp(UsbEndpointImp ep,
UsbPipeOsImp pipe)
Constructor. |
|
UsbPipeImp(UsbPipeOsImp pipe)
Constructor. |
Method Summary | |
---|---|
void |
abortAllSubmissions()
Stop all submissions in progress. |
void |
addUsbPipeListener(UsbPipeListener listener)
Register's the listener object for UsbPipeEvent |
UsbIrp |
asyncSubmit(byte[] data)
Asynchonously submits this byte[] array to the UsbPipe. |
void |
asyncSubmit(java.util.List list)
Asynchronous submission using a List of UsbIrps. |
void |
asyncSubmit(UsbIrp usbIrp)
Asynchronous submission using a UsbIrp. |
void |
close()
Closes this UsbPipe. |
UsbControlIrp |
createUsbControlIrp(byte bmRequestType,
byte bRequest,
short wValue,
short wIndex)
Create a UsbControlIrp. |
UsbIrp |
createUsbIrp()
Create a UsbIrp. |
UsbEndpoint |
getUsbEndpoint()
Get this pipe's UsbEndpoint. |
UsbEndpointImp |
getUsbEndpointImp()
|
UsbPipeOsImp |
getUsbPipeOsImp()
|
boolean |
isActive()
If this pipe is active. |
boolean |
isOpen()
If this pipe is open. |
void |
open()
Opens this UsbPipe. |
void |
removeUsbPipeListener(UsbPipeListener listener)
Removes the listener object from the listener list |
void |
setupUsbIrpImp(UsbIrpImp irp)
|
void |
setUsbEndpointImp(UsbEndpointImp ep)
Set the UsbEndpointImp. |
void |
setUsbPipeOsImp(UsbPipeOsImp pipe)
|
int |
syncSubmit(byte[] data)
Synchonously submits this byte[] array to the UsbPipe. |
void |
syncSubmit(java.util.List list)
Synchronous submission using a List of UsbIrps. |
void |
syncSubmit(UsbIrp usbIrp)
Synchronous submission using a UsbIrp. |
void |
usbIrpImpComplete(UsbIrpImp irp)
Indicate that a specific UsbIrpImp has completed. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PIPE_CONTROL_QUEUE_POLICY_KEY
public static final java.lang.String PIPE_INTERRUPT_QUEUE_POLICY_KEY
public static final java.lang.String PIPE_ISOCHRONOUS_QUEUE_POLICY_KEY
public static final java.lang.String PIPE_BULK_QUEUE_POLICY_KEY
public static final java.lang.String CREATE_SHORT_PACKET_EXCEPTION_POLICY_KEY
Constructor Detail |
---|
public UsbPipeImp()
public UsbPipeImp(UsbEndpointImp ep)
ep
- The UsbEndpointImp.public UsbPipeImp(UsbPipeOsImp pipe)
pipe
- The platform-dependent pipe implementation.public UsbPipeImp(UsbEndpointImp ep, UsbPipeOsImp pipe)
ep
- The UsbEndpointImp.pipe
- The platform-dependent pipe implementation.Method Detail |
---|
public UsbPipeOsImp getUsbPipeOsImp()
public void setUsbPipeOsImp(UsbPipeOsImp pipe)
pipe
- The UsbPipeOsImp to usepublic boolean isActive()
UsbPipe
This pipe is active only if it belongs to an
active configuration
and
interface setting
, otherwise it is inactive.
This UsbPipe cannot be used if inactive.
isActive
in interface UsbPipe
public boolean isOpen()
UsbPipe
This is true after a sucessful open
until a successful close
.
If this pipe is not active
, this returns false.
isOpen
in interface UsbPipe
public UsbEndpoint getUsbEndpoint()
UsbPipe
getUsbEndpoint
in interface UsbPipe
public UsbEndpointImp getUsbEndpointImp()
public void setUsbEndpointImp(UsbEndpointImp ep)
This will also set this on the parent UsbEndpointImp. This also sets up this pipe's queueing policy if the user defined one in the properties file.
ep
- The UsbEndpointImppublic void open() throws UsbException, UsbNotActiveException, UsbNotClaimedException, UsbDisconnectedException
open
in interface UsbPipe
UsbException
- If the UsbPipe could not be opened.
UsbNotActiveException
- If the config or interface setting is not active.
UsbNotClaimedException
- If the interface is not claimed.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public void close() throws UsbException, UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException
close
in interface UsbPipe
UsbException
- If the UsbPipe could not be closed.
UsbNotActiveException
- If the UsbPipe is not active.
UsbNotOpenException
- If the UsbPipe is not open.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public int syncSubmit(byte[] data) throws UsbException, java.lang.IllegalArgumentException, UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException
syncSubmit
in interface UsbPipe
data
- The buffer to use.
UsbException
- If an error occurs.
java.lang.IllegalArgumentException
- If the data is null.
UsbNotActiveException
- If the pipe is not active
.
UsbNotOpenException
- If the pipe is not open
.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public UsbIrp asyncSubmit(byte[] data) throws UsbException, java.lang.IllegalArgumentException, UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException
asyncSubmit
in interface UsbPipe
data
- The buffer to use.
UsbException
- If an error occurs.
java.lang.IllegalArgumentException
- If the data is null.
UsbNotActiveException
- If the pipe is not active
.
UsbNotOpenException
- If the pipe is not open
.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public void syncSubmit(UsbIrp usbIrp) throws UsbException, java.lang.IllegalArgumentException, UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException
syncSubmit
in interface UsbPipe
usbIrp
- A UsbIrp to use for the submission.
UsbException
- If an error occurs.
java.lang.IllegalArgumentException
- If the UsbIrp is not valid.
UsbNotActiveException
- If the pipe is not active
.
UsbNotOpenException
- If the pipe is not open
.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public void asyncSubmit(UsbIrp usbIrp) throws UsbException, java.lang.IllegalArgumentException, UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException
asyncSubmit
in interface UsbPipe
usbIrp
- The UsbIrp to use for the submission.
UsbException
- If an error occurs.
java.lang.IllegalArgumentException
- If the UsbIrp is not valid.
UsbNotActiveException
- If the pipe is not active
.
UsbNotOpenException
- If the pipe is not open
.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public void syncSubmit(java.util.List list) throws UsbException, java.lang.IllegalArgumentException, UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException
syncSubmit
in interface UsbPipe
list
- The List of UsbIrps.
UsbException
- If an error occurs.
java.lang.IllegalArgumentException
- If the list is empty or contains any non-UsbIrp objects, or those UsbIrp(s) are invalid.
UsbNotActiveException
- If the pipe is not active
.
UsbNotOpenException
- If the pipe is not open
.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public void asyncSubmit(java.util.List list) throws UsbException, java.lang.IllegalArgumentException, UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException
asyncSubmit
in interface UsbPipe
list
- The List of UsbIrps.
UsbException
- If an error occurs.
java.lang.IllegalArgumentException
- If the list is empty or contains any non-UsbIrp objects, or those UsbIrp(s) are invalid.
UsbNotActiveException
- If the pipe is not active
.
UsbNotOpenException
- If the pipe is not open
.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public void abortAllSubmissions() throws UsbNotActiveException, UsbNotOpenException, UsbDisconnectedException
abortAllSubmissions
in interface UsbPipe
UsbNotActiveException
- If the pipe is not active
.
UsbNotOpenException
- If the pipe is not open
.
UsbDisconnectedException
- If this pipe (device) has been disconnected.public UsbIrp createUsbIrp()
createUsbIrp
in interface UsbPipe
public UsbControlIrp createUsbControlIrp(byte bmRequestType, byte bRequest, short wValue, short wIndex)
createUsbControlIrp
in interface UsbPipe
bmRequestType
- The bmRequestType.bRequest
- The bRequest.wValue
- The wValue.wIndex
- The wIndex.
public void usbIrpImpComplete(UsbIrpImp irp)
This is called after isComplete() is set to true.
usbIrpImpComplete
in interface UsbIrpImp.UsbIrpImpListener
irp
- The UsbIrpImp that completed.public void addUsbPipeListener(UsbPipeListener listener)
addUsbPipeListener
in interface UsbPipe
listener
- the UsbPipeListener instancepublic void removeUsbPipeListener(UsbPipeListener listener)
removeUsbPipeListener
in interface UsbPipe
listener
- the UsbPipeListener instancepublic void setupUsbIrpImp(UsbIrpImp irp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |