public final class SerialComSLabsUSBXpressJNIBridge extends Object
This class is an interface between java and native shared library. The native library is found in the root of 'sp-tty.jar' file.
| Constructor and Description |
|---|
SerialComSLabsUSBXpressJNIBridge()
Allocates a new SerialComSLabsUSBXpressJNIBridge object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
cancelIO(long handle) |
long[] |
checkRXQueue(long handle) |
int |
close(long handle) |
int |
deviceIOControl(long handle,
int ctrlCode,
byte[] inputBuf,
int numBytesToRead,
byte[] outputBuf,
int numOfBytesToWrite) |
int |
flushBuffer(long handle,
byte flushTransmit,
byte flushReceive) |
long |
getDllVersion() |
long |
getDriverVersion() |
int |
getModemStatus(long handle) |
int |
getNumDevices() |
String |
getPartNumber(long handle) |
String |
getProductString(int index,
int flag) |
long[] |
getTimeouts() |
static boolean |
loadNativeLibrary(File libDirectory,
String vlibName,
int cpuArch,
int osType,
com.serialpundit.core.SerialComSystemProperty serialComSystemProperty)
Extract native library from jar in a working directory, load and link it.
|
long |
open(int index) |
int |
read(long handle,
byte[] buffer,
int numOfBytesToRead) |
long |
readLatch(long handle) |
int |
setBaudRate(long handle,
int baudrate) |
int |
setBreak(long handle,
int breakValue) |
int |
setFlowControl(long handle,
int ctsMaskCode,
int rtsMaskCode,
int dtrMaskCode,
int dsrMaskCode,
int dcdMaskCode,
int flowXonXoff) |
int |
setLineControl(long handle,
int lineControl) |
int |
setTimeouts(long handle,
long readTimeOut) |
int |
write(long handle,
byte[] buffer,
int numOfBytesToWrite) |
int |
writeLatch(long handle,
long mask,
long latchValue) |
public SerialComSLabsUSBXpressJNIBridge()
Allocates a new SerialComSLabsUSBXpressJNIBridge object.
public static boolean loadNativeLibrary(File libDirectory, String vlibName, int cpuArch, int osType, com.serialpundit.core.SerialComSystemProperty serialComSystemProperty) throws com.serialpundit.core.SerialComException
Extract native library from jar in a working directory, load and link it. The root of sp-tty.jar file is searched for the required native library for vendor specific communication. It also load vendor's native shared library.
libDirectory - directory in which native library will be extracted and vendor library will be found.vlibName - name of vendor library to load and link.cpuArch - architecture of CPU this library is running on.osType - operating system this library is running on.serialComSystemProperty - instance of SerialComSystemProperty to get required java properties.com.serialpundit.core.SerialComException - if java system properties can not be accessed or required files can not be
accessed, if shared library is not found, it can not be loaded, linked and initialized etc.public int getNumDevices()
public String getProductString(int index, int flag)
public long open(int index)
public int close(long handle)
public int read(long handle,
byte[] buffer,
int numOfBytesToRead)
public int write(long handle,
byte[] buffer,
int numOfBytesToWrite)
public int cancelIO(long handle)
public int flushBuffer(long handle,
byte flushTransmit,
byte flushReceive)
public int setTimeouts(long handle,
long readTimeOut)
public long[] getTimeouts()
public long[] checkRXQueue(long handle)
public int setBaudRate(long handle,
int baudrate)
public int setLineControl(long handle,
int lineControl)
public int setFlowControl(long handle,
int ctsMaskCode,
int rtsMaskCode,
int dtrMaskCode,
int dsrMaskCode,
int dcdMaskCode,
int flowXonXoff)
public int getModemStatus(long handle)
public int setBreak(long handle,
int breakValue)
public long readLatch(long handle)
public int writeLatch(long handle,
long mask,
long latchValue)
public String getPartNumber(long handle)
public long getDllVersion()
public long getDriverVersion()
public int deviceIOControl(long handle,
int ctrlCode,
byte[] inputBuf,
int numBytesToRead,
byte[] outputBuf,
int numOfBytesToWrite)
Copyright © 2017. All rights reserved.