public final class SerialComFTDID2XXJNIBridge 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 |
|---|
SerialComFTDID2XXJNIBridge()
Allocates a new SerialComFTDID2XXJNIBridge object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
clearDTR(long handle) |
int |
clearRTS(long handle) |
int |
close(long handle) |
int |
createDeviceInfoList() |
int |
cyclePort(long handle) |
int |
eeProgram(long handle,
String manufacturer,
String manufacturerID,
String description,
String serialNumber,
int[] values) |
int |
eeProgramEx(long handle,
String manufacturer,
String manufacturerID,
String description,
String serialNumber,
int[] values) |
int |
eepromProgram(long handle,
int devType,
int[] dataToBeWritten,
String manufacturer,
String manufacturerID,
String description,
String serialNumber) |
int[] |
eepromRead(long handle,
int deviceType,
char[] manufacturer,
char[] manufacturerID,
char[] description,
char[] serialNumber) |
int[] |
eeRead(long handle,
int version,
char[] manufacturer,
char[] manufacturerID,
char[] description,
char[] serialNumber) |
int |
eeUAread(long handle,
byte[] buffer,
int length) |
int |
eeUAsize(long handle) |
int |
eeUAwrite(long handle,
byte[] buffer,
int length) |
int |
eraseEE(long handle) |
int |
getBitMode(long handle) |
long |
getComPortNumber(long handle) |
String[] |
getDeviceInfo(long handle) |
String[] |
getDeviceInfoDetail(int index) |
String[] |
getDeviceInfoList(int numOfDevices) |
long |
getDriverVersion(long handle) |
int |
getLatencyTimer(long handle) |
long |
getLibraryVersion() |
int |
getModemStatus(long handle) |
int |
getQueueStatus(long handle) |
long[] |
getStatus(long handle) |
int[] |
getVidPid() |
String[] |
listDevices(int pvArg1,
int dwFlags) |
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) |
long |
openEx(String serialOrDescription,
long locationId,
int dwFlags) |
int |
purge(long handle,
boolean purgeTxBuffer,
boolean purgeRxBuffer) |
int |
read(long handle,
byte[] buffer,
int numOfBytesToRead) |
int |
readEE(long handle,
int offset) |
int |
reload(int vid,
int pid) |
int |
rescan() |
int |
resetDevice(long handle) |
int |
resetPort(long handle) |
int |
restartInTask(long handle) |
int |
setBaudRate(long handle,
int baudRate) |
int |
setBitMode(long handle,
int mask,
int mode) |
int |
setBreakOff(long handle) |
int |
setBreakOn(long handle) |
int |
setChars(long handle,
byte evch,
byte even,
byte erch,
byte eren) |
int |
setDataCharacteristics(long handle,
int dataBits,
int stopBits,
int parity) |
int |
setDeadmanTimeout(long handle,
int count) |
int |
setDivisor(long handle,
int divisor) |
int |
setDTR(long handle) |
int |
setEventNotificationAndWait(long handle,
int eventMask) |
int |
setFlowControl(long handle,
int flctrl,
byte xonch,
byte xoffch) |
int |
setLatencyTimer(long handle,
int value) |
int |
setResetPipeRetryCount(long handle,
int count) |
int |
setRTS(long handle) |
int |
setTimeouts(long handle,
long readTimeOut,
long writeTimeOut) |
int |
setUSBParameters(long handle,
int inTransferSize,
int outTransferSize) |
int |
setVidPid(int vid,
int pid) |
int |
stopInTask(long handle) |
int |
w32ClearCommBreak(long handle) |
int[] |
w32ClearCommError(long handle) |
int |
w32CloseHandle(long handle) |
long |
w32CreateFile(String serialNum,
String description,
long location,
int dwAttrsAndFlags,
int dwAccess,
boolean overLapped) |
int |
w32EscapeCommFunction(long handle,
short function) |
int |
w32GetCommMask(long handle) |
int |
w32GetCommModemStatus(long handle) |
int[] |
w32GetCommState(long handle) |
int[] |
w32GetCommTimeouts(long handle) |
String |
w32GetLastError(long handle) |
int |
w32GetOverlappedResult(long handle,
boolean wait) |
int |
w32PurgeComm(long handle,
int event) |
int |
w32ReadFile(long handle,
byte[] buffer,
int numOfBytesToRead) |
int |
w32SetCommBreak(long handle) |
int |
w32SetCommMask(long handle,
int flag) |
int |
w32SetCommState(long handle,
int[] dcb) |
int |
w32SetCommTimeouts(long handle,
int readIntervalTimeout,
int readTotalTimeoutMultiplier,
int readTotalTimeoutConstant,
int writeTotalTimeoutMultiplier,
int writeTotalTimeoutConstant) |
int |
w32SetupComm(long handle,
int readBufSize,
int writeBufSize) |
int |
w32WaitCommEvent(long handle,
int event) |
int |
w32WriteFile(long handle,
byte[] buffer,
int numOfBytesToWrite) |
int |
write(long handle,
byte[] buffer,
int numOfBytesToWrite) |
int |
writeEE(long handle,
int offset,
int valueToWrite) |
public SerialComFTDID2XXJNIBridge()
Allocates a new SerialComFTDID2XXJNIBridge 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 setVidPid(int vid,
int pid)
public int[] getVidPid()
public int createDeviceInfoList()
public String[] getDeviceInfoList(int numOfDevices)
public String[] getDeviceInfoDetail(int index)
public String[] listDevices(int pvArg1, int dwFlags)
public long open(int index)
public long openEx(String serialOrDescription, long locationId, int dwFlags)
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 setBaudRate(long handle,
int baudRate)
public int setDivisor(long handle,
int divisor)
public int setDataCharacteristics(long handle,
int dataBits,
int stopBits,
int parity)
public int setTimeouts(long handle,
long readTimeOut,
long writeTimeOut)
public int setFlowControl(long handle,
int flctrl,
byte xonch,
byte xoffch)
public int setDTR(long handle)
public int clearDTR(long handle)
public int setRTS(long handle)
public int clearRTS(long handle)
public int getModemStatus(long handle)
public int getQueueStatus(long handle)
public String[] getDeviceInfo(long handle)
public long getDriverVersion(long handle)
public long getLibraryVersion()
public long getComPortNumber(long handle)
public long[] getStatus(long handle)
public int setEventNotificationAndWait(long handle,
int eventMask)
public int setChars(long handle,
byte evch,
byte even,
byte erch,
byte eren)
public int setBreakOn(long handle)
public int setBreakOff(long handle)
public int purge(long handle,
boolean purgeTxBuffer,
boolean purgeRxBuffer)
public int resetDevice(long handle)
public int resetPort(long handle)
public int cyclePort(long handle)
public int rescan()
public int reload(int vid,
int pid)
public int setResetPipeRetryCount(long handle,
int count)
public int stopInTask(long handle)
public int restartInTask(long handle)
public int setDeadmanTimeout(long handle,
int count)
public int readEE(long handle,
int offset)
public int writeEE(long handle,
int offset,
int valueToWrite)
public int eraseEE(long handle)
public int[] eeRead(long handle,
int version,
char[] manufacturer,
char[] manufacturerID,
char[] description,
char[] serialNumber)
public int eeProgram(long handle,
String manufacturer,
String manufacturerID,
String description,
String serialNumber,
int[] values)
public int eeProgramEx(long handle,
String manufacturer,
String manufacturerID,
String description,
String serialNumber,
int[] values)
public int eeUAsize(long handle)
public int eeUAread(long handle,
byte[] buffer,
int length)
public int eeUAwrite(long handle,
byte[] buffer,
int length)
public int[] eepromRead(long handle,
int deviceType,
char[] manufacturer,
char[] manufacturerID,
char[] description,
char[] serialNumber)
public int eepromProgram(long handle,
int devType,
int[] dataToBeWritten,
String manufacturer,
String manufacturerID,
String description,
String serialNumber)
public int setLatencyTimer(long handle,
int value)
public int getLatencyTimer(long handle)
public int setBitMode(long handle,
int mask,
int mode)
public int getBitMode(long handle)
public int setUSBParameters(long handle,
int inTransferSize,
int outTransferSize)
public long w32CreateFile(String serialNum, String description, long location, int dwAttrsAndFlags, int dwAccess, boolean overLapped)
public int w32CloseHandle(long handle)
public int w32ReadFile(long handle,
byte[] buffer,
int numOfBytesToRead)
public int w32WriteFile(long handle,
byte[] buffer,
int numOfBytesToWrite)
public int w32GetOverlappedResult(long handle,
boolean wait)
public int w32EscapeCommFunction(long handle,
short function)
public int w32GetCommModemStatus(long handle)
public int w32SetupComm(long handle,
int readBufSize,
int writeBufSize)
public int w32SetCommState(long handle,
int[] dcb)
public int[] w32GetCommState(long handle)
public int w32SetCommTimeouts(long handle,
int readIntervalTimeout,
int readTotalTimeoutMultiplier,
int readTotalTimeoutConstant,
int writeTotalTimeoutMultiplier,
int writeTotalTimeoutConstant)
public int[] w32GetCommTimeouts(long handle)
public int w32SetCommBreak(long handle)
public int w32ClearCommBreak(long handle)
public int w32SetCommMask(long handle,
int flag)
public int w32GetCommMask(long handle)
public int w32WaitCommEvent(long handle,
int event)
public int w32PurgeComm(long handle,
int event)
public String w32GetLastError(long handle)
public int[] w32ClearCommError(long handle)
Copyright © 2017. All rights reserved.