public final class SerialComMCHPSIOJNIBridge extends Object
This class is an interface between java and native shared library. The native library is found in 'lib-vendor' folder in 'scm-x.x.x.jar' file.
| Constructor and Description |
|---|
SerialComMCHPSIOJNIBridge()
Allocates a new SerialComMCHPSIOJNIBridge object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
clearPin(int pinNumber) |
int |
configureIO(short ioMap) |
int |
configureIoDefaultOutput(short ioMap,
short ucDefValue) |
int |
configureMCP2200(byte ioMap,
long baudRateParam,
int rxLEDMode,
int txLEDMode,
boolean flow,
boolean uload,
boolean sspnd,
boolean invert) |
int |
fnInvertUartPol(int onOff) |
int |
fnRxLED(int mode) |
int |
fnSetBaudRate(long baudRateParam) |
int |
fnSuspend(int onOff) |
int |
fnTxLED(int mode) |
int |
fnULoad(int onOff) |
String |
getDeviceInfo(int uiDeviceNumber) |
int |
getNumOfDevices() |
int |
getSelectedDevice() |
String |
getSelectedDeviceInfo() |
int |
hardwareFlowControl(int onOff) |
int |
initMCP2200(int vendorID,
int productID) |
int |
isConnected() |
static boolean |
loadNativeLibrary(File libDirectory,
String vlibName,
int cpuArch,
int osType,
SerialComSystemProperty serialComSystemProperty)
Extract native library from jar in a working directory, load and link it.
|
int |
readEEPROM(int uiEEPAddress) |
int |
readPin(int pinNumber) |
int |
readPinValue(int pinNumber) |
int |
readPort() |
int |
readPortValue() |
int |
selectDevice(int uiDeviceNumber) |
int |
setPin(int pinNumber) |
int |
writeEEPROM(int uiEEPAddress,
short ucValue) |
int |
writePort(int portValue) |
public SerialComMCHPSIOJNIBridge()
Allocates a new SerialComMCHPSIOJNIBridge object.
public static boolean loadNativeLibrary(File libDirectory, String vlibName, int cpuArch, int osType, SerialComSystemProperty serialComSystemProperty) throws UnsatisfiedLinkError, SerialComLoadException, SerialComUnexpectedException, SecurityException, FileNotFoundException
Extract native library from jar in a working directory, load and link it. The 'lib-vendor' folder in 'scm-x.x.x.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 foundvlibName - name of vendor library to load and linkcpuArch - architecture of CPU this library is running onosType - operating system this library is running onserialComSystemProperty - instance of SerialComSystemProperty to get required java propertiesSerialComUnexpectedException - if a critical java system property is null in systemSecurityException - if any java system property can not be accessedFileNotFoundException - if the vendor library file is not foundSerialComLoadException - if any file system related issue occursUnsatisfiedLinkError - if loading/linking shared library failspublic int initMCP2200(int vendorID,
int productID)
public int isConnected()
public int configureMCP2200(byte ioMap,
long baudRateParam,
int rxLEDMode,
int txLEDMode,
boolean flow,
boolean uload,
boolean sspnd,
boolean invert)
public int setPin(int pinNumber)
public int clearPin(int pinNumber)
public int readPinValue(int pinNumber)
public int readPin(int pinNumber)
public int writePort(int portValue)
public int readPort()
public int readPortValue()
public int selectDevice(int uiDeviceNumber)
public int getSelectedDevice()
public int getNumOfDevices()
public String getDeviceInfo(int uiDeviceNumber)
public String getSelectedDeviceInfo()
public int readEEPROM(int uiEEPAddress)
public int writeEEPROM(int uiEEPAddress,
short ucValue)
public int fnRxLED(int mode)
public int fnTxLED(int mode)
public int hardwareFlowControl(int onOff)
public int fnULoad(int onOff)
public int fnSuspend(int onOff)
public int fnInvertUartPol(int onOff)
public int fnSetBaudRate(long baudRateParam)
public int configureIO(short ioMap)
public int configureIoDefaultOutput(short ioMap,
short ucDefValue)
Copyright © 2016. All rights reserved.