com.upek.android.ptapi
Interface PtGlobalI

All Known Implementing Classes:
PtGlobal

public interface PtGlobalI

Main class with basic static Ptapi library methods.


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.
 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.
 void terminate()
          Uninitialize the API library.
 

Method Detail

enumerateDevices

PtDeviceListItem[] enumerateDevices(java.lang.String enumDsn)
                                    throws PtException
Enumerate TFM/ESS devices

Parameters:
enumDsn - ASCII string describing the TFM/ESS connection interface, where enumeration is required, e.g. USB. Example: "usb".
Returns:
The list of found TFM/ESS devices. (Corresponds with parameter ppDeviceList in original function)
Throws:
PtException - Error code of fail, if any was accoured.

globalInfo

PtGlobalInfo globalInfo()
                        throws PtException
Get information about the API version and other global information, independent on any connection.

Returns:
Global info class. (Corresponds with parameter ppGlobalInfo in original function)
Throws:
PtException - Error code of fail, if any was accoured.

initialize

void initialize()
                throws PtException
Initialize the API library. Must be called before any other function.

Throws:
PtException - Error code of fail, if any was accoured.

initializeEx

void initializeEx(int flags)
                  throws PtException
Initialize the PTAPI library with possibility to set some additional flags.

Throws:
PtException - Error code of fail, if any was accoured.

open

PtConnectionI open(java.lang.String dsn)
                   throws PtException
Open new "local" connection to TFM.

Parameters:
dsn - ASCII string descriobing the TFM connection parameters, e.g. port number etc. Example: "Port=COM1".
Returns:
Resulting connection class. At the end of the connection it should be closed using close(). To close local connection you should call close(). (Corresponds with parameter phConnection in original function)
Throws:
PtException - Error code of fail, if any was accoured.

openDevice

PtConnectionI openDevice(java.lang.String dsn)
                         throws PtException
Opens and prepares connection interface with TFM/ESS. In order to open communication session function openSession() must be called afterwards. Call closeDevice() to close opened interface.

Parameters:
dsn - ASCII string descriobing the TFM/ESS connection interface parameters, e.g. port number etc. Example: "Port=COM1".
Returns:
Resulting connection class. (Corresponds with parameter phConnection in original function)
Throws:
PtException - Error code of fail, if any was accoured.

openRemote

PtConnectionI openRemote(PtCommCallback commCallback)
                         throws PtException
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. The callback function is described at the description of PtCommCallback.

Parameters:
commCallback - Application-provided callback to pass data packet to/from the remote library instance.
Returns:
Resulting connection class. At the end of the connection it should be closed using close(). (Corresponds with parameter phConnection in original function)
Throws:
PtException - Error code of fail, if any was accoured.

terminate

void terminate()
               throws PtException
Uninitialize the API library. Must not be called while any connection is still open. There is usually no need to call this function.

Throws:
PtException - Error code of fail, if any was accoured.