|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.comm.NativeComm
This class contains the interface to the native I/O methods. It acts as a bridge between the JVM and the various I/O drivers registered to the system.
Field Summary | |
static int |
PORT_LCD
Deprecated. The LCD driver is no longer supported. |
static int |
PORT_SERIAL0
I/O identifier for serial port 0 driver |
static int |
PORT_SERIAL1
I/O identifier for serial port 1 driver |
static int |
PORT_SERIAL2
I/O identifier for serial port 2 driver |
static int |
PORT_SERIAL3
I/O identifier for serial port 3 driver |
static int |
PORT_SERIAL4
I/O identifier for serial port 4 driver |
static int |
STREAM_STDIN
Denotes an input stream |
static int |
STREAM_STDOUT
Denotes an output stream |
Constructor Summary | |
NativeComm()
|
Method Summary | |
static int |
available(int handle)
Returns the number of bytes available in a driver. |
static int |
close(int handle)
Closes a previously opened port. |
static int |
ioctl(int handle,
byte[] arr,
int offset,
int length,
int timeout)
Performs a generic ioctl method. |
static int |
open(int port,
int stream)
Opens a port for use. |
static int |
read(int handle,
byte[] arr,
int timeout,
boolean suspend)
Calls the drivers read method. |
static int |
read(int handle,
byte[] arr,
int offset,
int length,
int timeout,
boolean suspend)
Calls the drivers read method. |
static void |
write(int handle,
byte[] arr)
Calls the drivers write method. |
static void |
write(int handle,
byte[] arr,
int offset,
int length)
Calls the drivers write method. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int STREAM_STDIN
public static final int STREAM_STDOUT
public static final int PORT_SERIAL0
public static final int PORT_SERIAL1
public static final int PORT_LCD
public static final int PORT_SERIAL2
public static final int PORT_SERIAL3
public static final int PORT_SERIAL4
Constructor Detail |
public NativeComm()
Method Detail |
public static int open(int port, int stream)
int handle = NativeComm.open(NativeComm.PORT_SERIAL0, NativeComm.STREAM_STDIN);
port
- The port type to open.stream
- The stream type to open.public static int close(int handle)
handle
- Handle of a previously opened port.public static void write(int handle, byte[] arr)
arr.length
.handle
- Stream handle returned from openarr
- Byte array of data.public static void write(int handle, byte[] arr, int offset, int length)
handle
- Stream handle returned from open.arr
- Byte array to write.length
- Ammount of data to write.public static int read(int handle, byte[] arr, int timeout, boolean suspend)
handle
- Stream handle to read fromarr
- Input Array.timeout
- Number of milliseconds to wait for data.suspend
- true
for suspend, false
for sleep with timeout.public static int read(int handle, byte[] arr, int offset, int length, int timeout, boolean suspend)
handle
- Stream handle to read fromarr
- Input Array.length
- Ammount of data to read.timeout
- Number of milliseconds to wait for data.suspend
- true
for suspend, false
for sleep with timeout.public static int ioctl(int handle, byte[] arr, int offset, int length, int timeout)
handle
- Stream Handle.arr
- Array of arguments to IOCTL call.length
- Length of array.timeout
- Ignored.public static int available(int handle)
handle
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |