com.toshiba.tgcsapi
Class TGCSMPOSDevice

java.lang.Object
  extended by com.toshiba.tgcsapi.TGCSMPOSDevice
Direct Known Subclasses:
TGCSMPOS4610CashDrawer, TGCSMPOS4610MICR, TGCSMPOS4610Printer

public class TGCSMPOSDevice
extends java.lang.Object


Constructor Summary
TGCSMPOSDevice()
           
 
Method Summary
 void addPOSEventListener(POSEventHandler handler)
          Add a POSEventHandler to the virtual device.
 void claim(int timeout)
          Perform the claim() operation.
 void clearInput()
          Perform clearInput() operation.
 void clearOutput()
          Perform clearOutput() operation.
 void close()
          Perform device close() operation.
 void directIO(int command, int data, java.lang.Object obj)
          Perform directIO() operation.
 boolean getClaimed()
          Obtain the claimed state of the virtual device.
 boolean getDataEventEnabled()
          Obtain DataEventEnabled state of the virtual device.
 boolean getDeviceEnabled()
          Obtain the DeviceEnabled state of the virtual device.
static ConfiguredDevice[] getDevices()
          This method will return an array of ConfiguredDevice registered with the SDK.
 int getOutputID()
          Obtain the OutputID value for the virtual device.
 java.lang.String getPhysicalDeviceName()
          Obtain the PhysicalDeviceName of the virtual device.
static java.lang.String getVersion()
          This class-wide method is used to obtain the API Version.
 void handleEvent(POSEvent event)
          Call the registered listeners to process the events that has been fired.
static void loadConfigurationFile(java.lang.String configurationFile)
          Loads a configuration file to the TGCS Mobile POS System.
static void loadMICRExceptionFile(java.lang.String micrExceptionFile)
          Load the MICR Exception File that will facilitate in the parsing of MICR data from the TGCS Printer.
 void open(java.lang.String logicalDeviceName)
          Perform device open() operation.
 void release()
          Perform release() operation.
 void removePOSEventListener(POSEventHandler handler)
          Removes a POSEventHandler from the virtual device.
 void setDataEventEnabled(boolean value)
          Set the DataEventEnabled attribute of the virtual device.
 void setDeviceEnabled(boolean value)
          Set the DeviceEnabled state of the virtual device.
 void unregisterAllEventHandlers()
          Removes all registered POSEventHandlers from the virtual device.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TGCSMPOSDevice

public TGCSMPOSDevice()
Method Detail

handleEvent

public void handleEvent(POSEvent event)
Call the registered listeners to process the events that has been fired.


addPOSEventListener

public void addPOSEventListener(POSEventHandler handler)
Add a POSEventHandler to the virtual device.

Parameters:
handler -

removePOSEventListener

public void removePOSEventListener(POSEventHandler handler)
Removes a POSEventHandler from the virtual device.

Parameters:
handler -

unregisterAllEventHandlers

public void unregisterAllEventHandlers()
Removes all registered POSEventHandlers from the virtual device.


getVersion

public static java.lang.String getVersion()
This class-wide method is used to obtain the API Version.

Returns:

loadConfigurationFile

public static void loadConfigurationFile(java.lang.String configurationFile)
Loads a configuration file to the TGCS Mobile POS System. The details of the configuration file will be stored and be applied system-wide on the device.

Parameters:
configurationFile -

loadMICRExceptionFile

public static void loadMICRExceptionFile(java.lang.String micrExceptionFile)
Load the MICR Exception File that will facilitate in the parsing of MICR data from the TGCS Printer.

Parameters:
micrExceptionFile -

getDevices

public static ConfiguredDevice[] getDevices()
This method will return an array of ConfiguredDevice registered with the SDK.

Returns:
array of ConfiguredDevice

open

public void open(java.lang.String logicalDeviceName)
          throws TGCSMPOSException
Perform device open() operation. This will create the virtual resources required for the object instance and establish the initial connection with the device. Throws Runtime Exception. For more information, refer to the UPOS Specification 1.13.

Throws:
TGCSMPOSException

close

public void close()
           throws TGCSMPOSException
Perform device close() operation. This will release the virtual resources held by the virtual device. Throws Runtime Exception. For more information, refer to the UPOS Specification 1.13.

Throws:
TGCSMPOSException

claim

public void claim(int timeout)
           throws TGCSMPOSException
Perform the claim() operation. Establish an exclusive access to the POS device in the network. Calling client must call release() to free the device for use. For more information, refer to the UPOS Specification 1.13. Throws Runtime Exception.

Throws:
TGCSMPOSException

release

public void release()
             throws TGCSMPOSException
Perform release() operation. This will release the virtual device's exclusive access to the device. Throws Runtime Exception. For more information, refer to the UPOS Specification 1.13.

Throws:
TGCSMPOSException

directIO

public void directIO(int command,
                     int data,
                     java.lang.Object obj)
              throws TGCSMPOSException
Perform directIO() operation. For more information, refer to the UPOS Specification 1.13.

Throws:
TGCSMPOSException

clearInput

public void clearInput()
                throws TGCSMPOSException
Perform clearInput() operation. Clears internal cached input from device. Refer to UPOS Specification 1.13 for more information.

Throws:
TGCSMPOSException

clearOutput

public void clearOutput()
                 throws TGCSMPOSException
Perform clearOutput() operation. Clears out-going command/data buffer of the virtual device designated for the physical device. Refer to UPOS Specification 1.13 for more information.

Throws:
TGCSMPOSException

getClaimed

public boolean getClaimed()
                   throws TGCSMPOSException
Obtain the claimed state of the virtual device.

Throws:
TGCSMPOSException

getDeviceEnabled

public boolean getDeviceEnabled()
                         throws TGCSMPOSException
Obtain the DeviceEnabled state of the virtual device.

Throws:
TGCSMPOSException

setDeviceEnabled

public void setDeviceEnabled(boolean value)
                      throws TGCSMPOSException
Set the DeviceEnabled state of the virtual device. Refer to UPOS Specification 1.13 for more information.

Throws:
TGCSMPOSException

getDataEventEnabled

public boolean getDataEventEnabled()
                            throws TGCSMPOSException
Obtain DataEventEnabled state of the virtual device.

Throws:
TGCSMPOSException

setDataEventEnabled

public void setDataEventEnabled(boolean value)
                         throws TGCSMPOSException
Set the DataEventEnabled attribute of the virtual device. Refer to UPOS Specification 1.13 for more information.

Throws:
TGCSMPOSException

getOutputID

public int getOutputID()
                throws TGCSMPOSException
Obtain the OutputID value for the virtual device. Refer to UPOS Specification for more information.

Throws:
TGCSMPOSException

getPhysicalDeviceName

public java.lang.String getPhysicalDeviceName()
                                       throws TGCSMPOSException
Obtain the PhysicalDeviceName of the virtual device. Refer to UPOS Specification for more information.

Throws:
TGCSMPOSException