|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.upek.android.ptapi.PtGlobal
public class PtGlobal
Main class with basic static Ptapi library methods.
Field Summary | |
---|---|
static int |
apiVersion
Version of API in form A.B.C = 0xAAAABBCC. |
static int |
dllVersion
Version of DLL. |
Constructor Summary | |
---|---|
PtGlobal()
Use and load the default native library name before first use of the class. |
Method Summary | |
---|---|
PtDeviceListItem[] |
enumerateDevices(java.lang.String enumDsn)
Enumerate TFM/ESS devices |
PtGlobalInfo |
globalInfo()
Get information about the API version and other global information, independent on any connection. |
void |
initialize()
Initialize the API library. |
void |
initializeEx(int flags)
Initialize the PTAPI library with possibility to set some additional flags. |
static void |
libraryIsAlreadyLoaded()
Signals to class, that the native library has been loaded by different way and shouldn't be loaded during first construct. |
static void |
loadLibrary()
Load native library with default name. |
PtConnectionI |
open(java.lang.String dsn)
Open new "local" connection to TFM. |
PtConnectionI |
openDevice(java.lang.String dsn)
Opens and prepares connection interface with TFM/ESS. |
PtConnectionI |
openRemote(PtCommCallback commCallback)
Open a new connection to a remote instance of PTAPI library, set the address of a communication callback for this connection and return a connection handle. |
static void |
removeWatchConnection(int handle)
Removes all connections with specified handle from watchedQueu. |
void |
terminate()
Uninitialize the API library. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int apiVersion
Increase of major version number means big change in API, which is not compatible with rules of minor version changes. These are: deleting of data Structure members and deleting whole structures and interfaces. After this change old DLL library can not be compatible with the newer JAR and while first use of PtGlobal (whose static constructor loads DLL) it will raise Error("Incompatible JniPtapi native library."). If a newer DLL is used with old JAR, everything will work correctly, as a DLL should be the same version.
Increase of subversion number means change only inside library without change of outer interface.
Before use of any method, the native library must be loaded by the same classloader which has loaded this class. By default, it will be done automatically during first construct of this class. It is possible to use methods loadLibray(), loadLibrary(libName), load(libFile). These methods are wrapping System.load() and System.loadLibrary calls(), the default one use the default library name (System.loadLibrary("jniidt");) Or it is possible load the native library by different way and signal this fact to class by libraryIsAlreadyLoaded(), constructor will not do the loading then.
public static int dllVersion
Constructor Detail |
---|
public PtGlobal()
Method Detail |
---|
public PtDeviceListItem[] enumerateDevices(java.lang.String enumDsn) throws PtException
PtGlobalI
enumerateDevices
in interface PtGlobalI
enumDsn
- ASCII string describing the TFM/ESS
connection interface, where enumeration is required,
e.g. USB. Example: "usb".
PtException
- Error code of fail, if any was accoured.public PtGlobalInfo globalInfo() throws PtException
PtGlobalI
globalInfo
in interface PtGlobalI
PtException
- Error code of fail, if any was accoured.public void initialize() throws PtException
PtGlobalI
initialize
in interface PtGlobalI
PtException
- Error code of fail, if any was accoured.public void initializeEx(int flags) throws PtException
PtGlobalI
initializeEx
in interface PtGlobalI
PtException
- Error code of fail, if any was accoured.public static void libraryIsAlreadyLoaded()
public static void loadLibrary()
public PtConnectionI open(java.lang.String dsn) throws PtException
PtGlobalI
open
in interface PtGlobalI
dsn
- ASCII string descriobing the TFM connection
parameters, e.g. port number etc. Example: "Port=COM1".
PtException
- Error code of fail, if any was accoured.public PtConnectionI openDevice(java.lang.String dsn) throws PtException
PtGlobalI
openDevice
in interface PtGlobalI
dsn
- ASCII string descriobing the TFM/ESS connection
interface parameters, e.g. port number etc. Example: "Port=COM1".
PtException
- Error code of fail, if any was accoured.public PtConnectionI openRemote(PtCommCallback commCallback) throws PtException
PtGlobalI
openRemote
in interface PtGlobalI
commCallback
- Application-provided callback to pass data packet to/from
the remote library instance.
PtException
- Error code of fail, if any was accoured.public static void removeWatchConnection(int handle)
handle
- is native connection handle for removepublic void terminate() throws PtException
PtGlobalI
terminate
in interface PtGlobalI
PtException
- Error code of fail, if any was accoured.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |