public final class SerialComSLabsUSBXpressJNIBridge extends Object
This class is an interface between java and native shared library. The native library is found in 'lib-vendor' folder in 'scm-x.x.x.jar' file.
| Constructor and Description |
|---|
SerialComSLabsUSBXpressJNIBridge()
Allocates a new SerialComSLabsUSBXpressJNIBridge object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
cancelIO(long handle) |
long[] |
checkRXQueue() |
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 handle) |
long |
getDriverVersion(long handle) |
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,
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,
long writeTimeOut) |
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, SerialComSystemProperty serialComSystemProperty) throws UnsatisfiedLinkError, SerialComLoadException, SerialComUnexpectedException, SecurityException, FileNotFoundException
Extract native library from jar in a working directory, load and link it. The 'lib-vendor' folder in 'scm-x.x.x.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 foundvlibName - name of vendor library to load and linkcpuArch - architecture of CPU this library is running onosType - operating system this library is running onserialComSystemProperty - instance of SerialComSystemProperty to get required java propertiesSerialComUnexpectedException - if a critical java system property is null in systemSecurityException - if any java system property can not be accessedFileNotFoundException - if the vendor library file is not foundSerialComLoadException - if any file system related issue occursUnsatisfiedLinkError - if loading/linking shared library failspublic 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,
long writeTimeOut)
public long[] getTimeouts()
public long[] checkRXQueue()
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(long handle)
public long getDriverVersion(long handle)
public int deviceIOControl(long handle,
int ctrlCode,
byte[] inputBuf,
int numBytesToRead,
byte[] outputBuf,
int numOfBytesToWrite)
Copyright © 2016. All rights reserved.