public final class SerialComUSBJNIBridge extends Object
This class is an interface between java and native shared library. The native library is found in the root of 'sp-usb.jar' file. Library will be spusblnxx64.so etc.
| Constructor and Description |
|---|
SerialComUSBJNIBridge()
Allocates a new SerialComUSBJNIBridge object.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
findComPortFromUSBAttribute(int usbVidToMatch,
int usbPidToMatch,
String serialNumber) |
String[] |
findComPortFromUSBAttributes(int usbVidToMatch,
int usbPidToMatch,
String serialNumber) |
String[] |
getCDCUSBDevPowerInfo(String portNameVal) |
String[] |
getFirmwareRevisionNumber(int vid,
int pid,
String serialNumber) |
int |
getLatencyTimer(String comPort) |
void |
initNativeLib() |
int |
isUSBDevConnected(int vendorID,
int productID,
String serialNumber) |
String[] |
listUSBdevicesWithInfo(int vendorFilter) |
String[] |
listUSBHIDdevicesWithInfo(int vendorFilter) |
static boolean |
loadNativeLibrary(String directoryPath,
String loadedLibName,
com.serialpundit.core.SerialComSystemProperty serialComSystemProperty,
int osType,
int cpuArch,
int abitype)
Extract native library from jar in a 'directoryPath' directory, load and link it.
|
int |
registerUSBHotPlugEventListener(ISerialComUSBHotPlugListener hotPlugListener,
int filterVID,
int filterPID,
String serialNumber) |
int |
setLatencyTimer(String comPort,
byte timerValue) |
int |
unregisterUSBHotPlugEventListener(int index) |
public SerialComUSBJNIBridge()
Allocates a new SerialComUSBJNIBridge object.
public static boolean loadNativeLibrary(String directoryPath, String loadedLibName, com.serialpundit.core.SerialComSystemProperty serialComSystemProperty, int osType, int cpuArch, int abitype) throws com.serialpundit.core.SerialComException
Extract native library from jar in a 'directoryPath' directory, load and link it. Native library is found in the root of 'sp-usb.jar' file.
directoryPath - null for default directory or user supplied directory path.loadedLibName - null for default name or user supplied name of loaded library.serialComSystemProperty - instance of SerialComSystemProperty to get required java properties.cpuArch - architecture of CPU this library is running on.osType - operating system this library is running on.abitype - binary application interface type to correctly link.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 String[] findComPortFromUSBAttribute(int usbVidToMatch, int usbPidToMatch, String serialNumber)
public void initNativeLib()
public String[] listUSBdevicesWithInfo(int vendorFilter)
public String[] getFirmwareRevisionNumber(int vid, int pid, String serialNumber)
public int registerUSBHotPlugEventListener(ISerialComUSBHotPlugListener hotPlugListener, int filterVID, int filterPID, String serialNumber)
public int unregisterUSBHotPlugEventListener(int index)
public int isUSBDevConnected(int vendorID,
int productID,
String serialNumber)
public String[] findComPortFromUSBAttributes(int usbVidToMatch, int usbPidToMatch, String serialNumber)
public int setLatencyTimer(String comPort, byte timerValue)
public int getLatencyTimer(String comPort)
public String[] listUSBHIDdevicesWithInfo(int vendorFilter)
Copyright © 2017. All rights reserved.