public final class SerialComHIDJNIBridge extends Object
This class is an interface between java and native shared library. The native library is found in the root of 'sp-hid.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() |
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 working directory, load and link it.
|
long |
openHidDeviceByPathR(String pathNameVal,
boolean shared) |
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, com.serialpundit.core.SerialComSystemProperty serialComSystemProperty, int osType, int cpuArch, int abiType) throws com.serialpundit.core.SerialComException
Extract native library from jar in a working directory, load and link it. The native library is found in the root of 'sp-hid.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 is null, if any file system related issue occurs.SecurityException - if java system properties can not be accessed or required files can not be accessed.UnsatisfiedLinkError - if loading/linking shared library fails.public int initNativeLib()
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 © 2017. All rights reserved.