|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjssc.SerialNativeInterface
public class SerialNativeInterface
| Field Summary | |
|---|---|
static long |
ERR_INCORRECT_SERIAL_PORT
|
static long |
ERR_PERMISSION_DENIED
|
static long |
ERR_PORT_BUSY
|
static long |
ERR_PORT_NOT_FOUND
|
static int |
OS_LINUX
|
static int |
OS_MAC_OS_X
|
static int |
OS_SOLARIS
|
static int |
OS_WINDOWS
|
static java.lang.String |
PROPERTY_JSSC_IGNPAR
|
static java.lang.String |
PROPERTY_JSSC_NO_TIOCEXCL
|
static java.lang.String |
PROPERTY_JSSC_PARMRK
|
| Constructor Summary | |
|---|---|
SerialNativeInterface()
|
|
| Method Summary | |
|---|---|
boolean |
closePort(long handle)
Close port |
int[] |
getBuffersBytesCount(long handle)
Get bytes count in buffers of port |
int |
getEventsMask(long handle)
Get events mask |
int |
getFlowControlMode(long handle)
Get flow control mode |
static java.lang.String |
getLibraryBaseVersion()
Get jSSC Base Version |
static java.lang.String |
getLibraryMinorSuffix()
Get jSSC minor suffix. |
static java.lang.String |
getLibraryVersion()
Get jSSC version. |
int[] |
getLinesStatus(long handle)
Getting lines states |
static java.lang.String |
getNativeLibraryVersion()
Get jSSC native library version |
static int |
getOsType()
Get OS type (OS_LINUX || OS_WINDOWS || OS_SOLARIS) |
java.lang.String[] |
getSerialPortNames()
Get serial port names like an array of String |
long |
openPort(java.lang.String portName,
boolean useTIOCEXCL)
Open port |
boolean |
purgePort(long handle,
int flags)
Purge of input and output buffer |
byte[] |
readBytes(long handle,
int byteCount)
Read data from port |
boolean |
sendBreak(long handle,
int duration)
Send Break singnal for setted duration |
boolean |
setDTR(long handle,
boolean value)
Change DTR line state |
boolean |
setEventsMask(long handle,
int mask)
Set events mask |
boolean |
setFlowControlMode(long handle,
int mask)
Set flow control mode |
boolean |
setParams(long handle,
int baudRate,
int dataBits,
int stopBits,
int parity,
boolean setRTS,
boolean setDTR,
int flags)
Setting the parameters of opened port |
boolean |
setRTS(long handle,
boolean value)
Change RTS line state |
int[][] |
waitEvents(long handle)
Wait events |
boolean |
writeBytes(long handle,
byte[] buffer)
Write data to port |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OS_LINUX
public static final int OS_WINDOWS
public static final int OS_SOLARIS
public static final int OS_MAC_OS_X
public static final long ERR_PORT_BUSY
public static final long ERR_PORT_NOT_FOUND
public static final long ERR_PERMISSION_DENIED
public static final long ERR_INCORRECT_SERIAL_PORT
public static final java.lang.String PROPERTY_JSSC_NO_TIOCEXCL
public static final java.lang.String PROPERTY_JSSC_IGNPAR
public static final java.lang.String PROPERTY_JSSC_PARMRK
| Constructor Detail |
|---|
public SerialNativeInterface()
| Method Detail |
|---|
public static int getOsType()
public static java.lang.String getLibraryVersion()
public static java.lang.String getLibraryBaseVersion()
public static java.lang.String getLibraryMinorSuffix()
public static java.lang.String getNativeLibraryVersion()
public long openPort(java.lang.String portName,
boolean useTIOCEXCL)
portName - name of port for openinguseTIOCEXCL - enable/disable using of TIOCEXCL. Take effect only on *nix based systems
public boolean setParams(long handle,
int baudRate,
int dataBits,
int stopBits,
int parity,
boolean setRTS,
boolean setDTR,
int flags)
handle - handle of opened portbaudRate - data transfer ratedataBits - number of data bitsstopBits - number of stop bitsparity - paritysetRTS - initial state of RTS line (ON/OFF)setDTR - initial state of DTR line (ON/OFF)flags - additional Native settings. Take effect only on *nix based systems
public boolean purgePort(long handle,
int flags)
handle - handle of opened portflags - flags specifying required actions for purgePort method
public boolean closePort(long handle)
handle - handle of opened port
public boolean setEventsMask(long handle,
int mask)
handle - handle of opened portmask - events mask
public int getEventsMask(long handle)
handle - handle of opened port
public int[][] waitEvents(long handle)
handle - handle of opened port
public boolean setRTS(long handle,
boolean value)
handle - handle of opened portvalue - true - ON, false - OFF
public boolean setDTR(long handle,
boolean value)
handle - handle of opened portvalue - true - ON, false - OFF
public byte[] readBytes(long handle,
int byteCount)
handle - handle of opened portbyteCount - count of bytes required to read
public boolean writeBytes(long handle,
byte[] buffer)
handle - handle of opened portbuffer - array of bytes to write
public int[] getBuffersBytesCount(long handle)
handle - handle of opened port
public boolean setFlowControlMode(long handle,
int mask)
handle - handle of opened portmask - mask of flow control mode
public int getFlowControlMode(long handle)
handle - handle of opened port
public java.lang.String[] getSerialPortNames()
public int[] getLinesStatus(long handle)
handle - handle of opened port
public boolean sendBreak(long handle,
int duration)
handle - handle of opened portduration - duration of Break signal
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||