public final class SerialComHIDJNIBridge extends Object
This class is an interface between java and native shared library. The native library is found in 'lib-hid' folder in 'scm-x.x.x.jar' file.
| Constructor and Description |
|---|
SerialComHIDJNIBridge()
Allocates a new SerialComHIDJNIBridge object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
closeHidDeviceR(long handle) |
long |
createBlockingHIDIOContextR() |
int |
destroyBlockingIOContextR(long context) |
String |
findDriverServingHIDDeviceR(String hidDeviceNode) |
int |
flushInputReportQueueR(long handle) |
int |
getFeatureReportR(long handle,
byte reportId,
byte[] report,
int length) |
String |
getIndexedStringR(long handle,
int index) |
String |
getManufacturerStringR(long handle) |
byte[] |
getPhysicalDescriptorR(long handle) |
String |
getProductStringR(long handle) |
byte[] |
getReportDescriptorR(long handle) |
String |
getSerialNumberStringR(long handle) |
int |
initNativeLib() |
String[] |
listHIDdevicesWithInfoR() |
String[] |
listUSBHIDdevicesWithInfo(int vendorFilter) |
static boolean |
loadNativeLibrary(String directoryPath,
String loadedLibName,
SerialComSystemProperty serialComSystemProperty,
int osType,
int cpuArch,
int javaABIType)
Extract native library from jar in a working directory, load and link it.
|
long |
openHidDeviceByPathR(String pathNameVal,
boolean shared) |
long |
openHidDeviceByUSBAttributes(int usbVidToMatch,
int usbPidToMatch,
String serialNum,
int locationID,
int usbBusNumber,
int usbDevNumber) |
long |
openHidDeviceR(String pathNameVal,
boolean shared,
int osType) |
int |
readInputReportR(long handle,
byte[] reportBuffer,
int length,
long context) |
int |
readInputReportWithTimeoutR(long handle,
byte[] reportBuffer,
int length,
int timeoutValue) |
int |
readPlatformSpecificInputReportR(long handle,
byte reportId,
byte[] reportBuffer,
int length) |
int |
sendFeatureReportR(long handle,
byte reportId,
byte[] report,
int length) |
int |
unblockBlockingHIDIOOperationR(long context) |
int |
writeOutputReportR(long handle,
byte reportId,
byte[] report,
int length) |
int |
writePlatformSpecificOutputReportR(long handle,
byte reportId,
byte[] reportBuffer,
int length) |
public SerialComHIDJNIBridge()
Allocates a new SerialComHIDJNIBridge object.
public static boolean loadNativeLibrary(String directoryPath, String loadedLibName, SerialComSystemProperty serialComSystemProperty, int osType, int cpuArch, int javaABIType) throws SecurityException, SerialComUnexpectedException, SerialComLoadException, UnsatisfiedLinkError
Extract native library from jar in a working directory, load and link it. The 'lib-hid' folder in 'scm-x.x.x.jar' file is searched for the required native library for communication with HID device.
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.javaABIType - binary application interface type to correctly link.SecurityException - if java system properties can not be accessed.SerialComUnexpectedException - if java system property is null.SerialComLoadException - if any file system related issue occurs.UnsatisfiedLinkError - if loading/linking shared library fails.public int initNativeLib()
public String[] listUSBHIDdevicesWithInfo(int vendorFilter)
public long openHidDeviceByUSBAttributes(int usbVidToMatch,
int usbPidToMatch,
String serialNum,
int locationID,
int usbBusNumber,
int usbDevNumber)
public long openHidDeviceR(String pathNameVal, boolean shared, int osType)
public long openHidDeviceByPathR(String pathNameVal, boolean shared)
public int closeHidDeviceR(long handle)
public long createBlockingHIDIOContextR()
public int unblockBlockingHIDIOOperationR(long context)
public int destroyBlockingIOContextR(long context)
public int writeOutputReportR(long handle,
byte reportId,
byte[] report,
int length)
public int readInputReportR(long handle,
byte[] reportBuffer,
int length,
long context)
public int readInputReportWithTimeoutR(long handle,
byte[] reportBuffer,
int length,
int timeoutValue)
public int readPlatformSpecificInputReportR(long handle,
byte reportId,
byte[] reportBuffer,
int length)
public int writePlatformSpecificOutputReportR(long handle,
byte reportId,
byte[] reportBuffer,
int length)
public int sendFeatureReportR(long handle,
byte reportId,
byte[] report,
int length)
public int getFeatureReportR(long handle,
byte reportId,
byte[] report,
int length)
public String[] listHIDdevicesWithInfoR()
public String getManufacturerStringR(long handle)
public String getProductStringR(long handle)
public String getSerialNumberStringR(long handle)
public String getIndexedStringR(long handle, int index)
public int flushInputReportQueueR(long handle)
public byte[] getReportDescriptorR(long handle)
public byte[] getPhysicalDescriptorR(long handle)
Copyright © 2016. All rights reserved.