public final class SerialComCP210xManufacturingJNIBridge 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. The CP210xManufacturing shared library is given in source form in AN721SW package.
| Constructor and Description |
|---|
SerialComCP210xManufacturingJNIBridge()
Allocates a new SerialComCP210xManufacturingJNIBridge object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
close(long handle) |
int |
createHexFile(long handle,
String fileName) |
int[] |
getBaudRateConfig(long handle) |
String |
getDeviceInterfaceString(long handle,
byte bInterfaceNumber) |
String |
getDeviceManufacturerString(long handle) |
byte[] |
getDeviceMode(long handle) |
int |
getDevicePid(long handle) |
String |
getDeviceProductString(long handle) |
String |
getDeviceSerialNumber(long handle) |
int |
getDeviceVersion(long handle) |
int |
getDeviceVid(long handle) |
int[] |
getDualPortConfig(long handle) |
int |
getFlushBufferConfig(long handle) |
int |
getLockValue(long handle) |
int |
getMaxPower(long handle) |
int |
getNumDevices() |
String |
getPartNumber(long handle) |
int[] |
getPortConfig(long handle) |
String |
getProductString(int index,
int flag) |
int[] |
getQuadPortConfig(long handle) |
int |
getSelfPower(long handle) |
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 |
reset(long handle) |
int |
setBaudRateConfig(long handle,
int baudGen,
int timer0Reload,
int prescalar,
int baudrate) |
int |
setDeviceMode(long handle,
byte bDeviceModeECI,
byte bDeviceModeSCI) |
int |
setDeviceVersion(long handle,
int version) |
int |
setDualPortConfig(long handle,
int mode,
int resetLatch,
int suspendLatch,
int enhancedFxnECI,
int enhancedFxnSCI,
int enhancedFxnDevice) |
int |
setFlushBufferConfig(long handle,
int flag) |
int |
setInterfaceString(long handle,
byte bInterfaceNumber,
String interfaceString) |
int |
setLockValue(long handle) |
int |
setMaxPower(long handle,
byte maxPower) |
int |
setPid(long handle,
int pid) |
int |
setPortConfig(long handle,
int mode,
int resetLatch,
int suspendLatch,
int enhancedFxn) |
int |
setProductString(long handle,
String product) |
int |
setQuadPortConfig(long handle,
int[] resetLatch,
int[] suspendLatch,
byte[] config) |
int |
setSelfPower(long handle,
boolean selfPower) |
int |
setSerialNumber(long handle,
String serialNumber) |
int |
setVid(long handle,
int vid) |
public SerialComCP210xManufacturingJNIBridge()
Allocates a new SerialComCP210xManufacturingJNIBridge 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 int reset(long handle)
public int createHexFile(long handle,
String fileName)
public String getPartNumber(long handle)
public String getDeviceManufacturerString(long handle)
public long open(int index)
public int close(long handle)
public int setProductString(long handle,
String product)
public String getProductString(int index, int flag)
public String getDeviceProductString(long handle)
public int setVid(long handle,
int vid)
public int getDeviceVid(long handle)
public int setPid(long handle,
int pid)
public int getDevicePid(long handle)
public int setSerialNumber(long handle,
String serialNumber)
public String getDeviceSerialNumber(long handle)
public int setInterfaceString(long handle,
byte bInterfaceNumber,
String interfaceString)
public String getDeviceInterfaceString(long handle, byte bInterfaceNumber)
public int setSelfPower(long handle,
boolean selfPower)
public int getSelfPower(long handle)
public int setMaxPower(long handle,
byte maxPower)
public int getMaxPower(long handle)
public int setFlushBufferConfig(long handle,
int flag)
public int getFlushBufferConfig(long handle)
public int setDeviceMode(long handle,
byte bDeviceModeECI,
byte bDeviceModeSCI)
public byte[] getDeviceMode(long handle)
public int setDeviceVersion(long handle,
int version)
public int getDeviceVersion(long handle)
public int setBaudRateConfig(long handle,
int baudGen,
int timer0Reload,
int prescalar,
int baudrate)
public int[] getBaudRateConfig(long handle)
public int setPortConfig(long handle,
int mode,
int resetLatch,
int suspendLatch,
int enhancedFxn)
public int[] getPortConfig(long handle)
public int setDualPortConfig(long handle,
int mode,
int resetLatch,
int suspendLatch,
int enhancedFxnECI,
int enhancedFxnSCI,
int enhancedFxnDevice)
public int[] getDualPortConfig(long handle)
public int setQuadPortConfig(long handle,
int[] resetLatch,
int[] suspendLatch,
byte[] config)
public int[] getQuadPortConfig(long handle)
public int setLockValue(long handle)
public int getLockValue(long handle)
Copyright © 2017. All rights reserved.