com.dalsemi.comm
Class NativeComm

java.lang.Object
  |
  +--com.dalsemi.comm.NativeComm

public class NativeComm
extends Object

Class declaration


Field Summary
static int PORT_LCD
          Field PORT_LCD
static int PORT_SERIAL0
          Field PORT_SERIAL0
static int PORT_SERIAL1
          Field PORT_SERIAL1
static int PORT_SERIAL2
          Field PORT_SERIAL2
static int PORT_SERIAL3
          Field PORT_SERIAL3
static int STREAM_COMMAND
          Field STREAM_COMMAND
static int STREAM_GENERIC
          Field STREAM_GENERIC
static int STREAM_STDERR
          Field STREAM_STDERR
static int STREAM_STDIN
          Field STREAM_STDIN
static int STREAM_STDOUT
          Field STREAM_STDOUT
 
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 setHandle(int handle)
          Method setHandle
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

STREAM_COMMAND

public static final int STREAM_COMMAND
Field STREAM_COMMAND

STREAM_STDIN

public static final int STREAM_STDIN
Field STREAM_STDIN

STREAM_STDOUT

public static final int STREAM_STDOUT
Field STREAM_STDOUT

STREAM_STDERR

public static final int STREAM_STDERR
Field STREAM_STDERR

STREAM_GENERIC

public static final int STREAM_GENERIC
Field STREAM_GENERIC

PORT_SERIAL0

public static final int PORT_SERIAL0
Field PORT_SERIAL0

PORT_SERIAL1

public static final int PORT_SERIAL1
Field PORT_SERIAL1

PORT_LCD

public static final int PORT_LCD
Field PORT_LCD

PORT_SERIAL2

public static final int PORT_SERIAL2
Field PORT_SERIAL2

PORT_SERIAL3

public static final int PORT_SERIAL3
Field PORT_SERIAL3
Constructor Detail

NativeComm

public NativeComm()
Method Detail

setHandle

public static void setHandle(int handle)
Method setHandle
Parameters:
handle -  

open

public static int open(int port,
                       int stream)
opens a port for use.
Parameters:
port - - The port type to open.
stream - - The stream type to open.
Returns:
- handle to the opened port.
See Also:

close

public static int close(int handle)
Closes a previously opened port.
Parameters:
handle - - handle of a previously opened port.
Returns:
- success/failure(0)
See Also:

write

public static void write(int handle,
                         byte[] arr)
Calls the drivers write method.
Parameters:
handle -  
arr -  
See Also:

write

public static void write(int handle,
                         byte[] arr,
                         int offset,
                         int length)
Calls the drivers write method.
Parameters:
handle -  
arr -  
length -  
See Also:

read

public static int read(int handle,
                       byte[] arr,
                       int timeout,
                       boolean suspend)
Calls the drivers read method.
Parameters:
handle -  
arr -  
timeout -  
Returns:
 
See Also:

read

public static int read(int handle,
                       byte[] arr,
                       int offset,
                       int length,
                       int timeout,
                       boolean suspend)
Calls the drivers read method.
Parameters:
handle -  
arr -  
length -  
timeout -  
suspend - - false - never times out.
Returns:
 
See Also:

ioctl

public static int ioctl(int handle,
                        byte[] arr,
                        int offset,
                        int length,
                        int timeout)
Performs a generic ioctl method. The driver is responsible for the format of the data passed to it.
Parameters:
handle -  
arr -  
length -  
timeout -  
Returns:
 
See Also:

available

public static int available(int handle)
returns the number of bytes available in a driver.
Parameters:
handle -  
Returns:
 
See Also: