|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.comm.USBConnection
public class USBConnection
Represents a USB Stream Connection.
Constructor Summary | |
---|---|
USBConnection(int mode)
|
Method Summary | |
---|---|
void |
close()
Close the USB stream connection. |
DataInputStream |
openDataInputStream()
Return the DataInputStream for this connect |
DataOutputStream |
openDataOutputStream()
Return the DataOutputStream for this connection. |
InputStream |
openInputStream()
Return the InputStream for this connection. |
OutputStream |
openOutputStream()
Return the OutputStream for this connection |
int |
read(byte[] data,
int len)
Perform an blocking read on the USB connection |
int |
read(byte[] data,
int len,
boolean wait)
Perform an optionally blocking read on the USB connection |
void |
setIOMode(int mode)
Set the IO mode to be used for this connection. |
int |
write(byte[] data,
int len)
|
int |
write(byte[] data,
int len,
boolean wait)
Write the requested bytes to the USB connection |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
Constructor Detail |
---|
public USBConnection(int mode)
Method Detail |
---|
public void close()
close
in interface Connection
public InputStream openInputStream()
openInputStream
in interface InputConnection
public OutputStream openOutputStream()
openOutputStream
in interface OutputConnection
public DataInputStream openDataInputStream()
openDataInputStream
in interface InputConnection
public DataOutputStream openDataOutputStream()
openDataOutputStream
in interface OutputConnection
public int read(byte[] data, int len, boolean wait)
read
in interface NXTConnection
data
- byte array to store the results.len
- max number of bytes to readwait
- set true to block waiting for data
public int read(byte[] data, int len)
read
in interface NXTConnection
data
- byte array to store the results.len
- max number of bytes to read
public int write(byte[] data, int len, boolean wait)
write
in interface NXTConnection
data
- data to be writtenlen
- number of bytes to writewait
- true to block to write the data.
public int write(byte[] data, int len)
write
in interface NXTConnection
public void setIOMode(int mode)
mode
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |