Skip to main content

Setup Configuration

The configuration of the Terminal can be done in two ways:

  1. In a configuration file "TimApi.cfg".
2. Using / configuring the [TerminalSettings](https://six-tim.github.io/timapi/doc/java/doc/com/six/timapi/TerminalSettings.html) within the application.

The settings defined in the .cfg file will be overwritten by the changes done using the API code directly.

Once a Terminal-instance has been created with a TerminalSettings-instance, the settings can not be changed anymore. Changes to the TerminalSettings-instance will be ignored.

The network and guides configuration as well as the configuration file are explained in the following chapters. For further information refer to TerminalSettings.

Network Configuration​

Depending on the platform used, the TIM API module can communicate with the Terminal over different communication channels.

The default communication is over TCP/IP connection. Default port used is 7784.

On mobile devices also a Bluetooth connection is possible.

For TCP/IP connection there are two possible ways to connect to the terminal:

  * **Broadcast-Mode:**
* Terminal ID (TID) is known.
* The TIM API starts broadcasting on the default interface and connects to the connection information sent by the matching terminal.
* **Direct Connect:**
* IP address of the terminal is known.
* Connection is established directly via IP.

Guides Configuration​

There are various Guides covering different use case scenarios. The guide Retailis the basic guide and is activated as default. With setGuides the guides can be configured. Important: the configuration needs to include all desired guides (including the retail guide).

Code-example for creating a terminal including settings with activated guides retail and hospitality:

// Create settings with Terminal-ID of terminal to connect to
com.six.TerminalSettings settings = new com.six.TerminalSettings();
settings.setTerminalId("12345678");
// add wanted guides (with bitwise or)
settings.setGuides(EnumSet.of(Guides.RETAIL, Guides.HOSPITALITY));
// Create terminal
com.six.Terminal terminal = new com.six.Terminal(settings);
//...

// Disconnect from terminal and clean up properly
terminal.dispose();

Configuration File​

With the use of the configuration file "TimApi.cfg" TerminalSettings can be set from outside of the application. If the user wishes to use multiple instances of the Terminal class it can be configured using ini-sections in the config file which are separated with a user defined DeviceId. The same DeviceId has to be used in the constructor of the TerminalSettings class if the specified configuration is wished to use. If no DeviceId is specified the global ini-section is used.

The precedence of the configuration is as follows:

  1. TimApi.cfg will be read first by creating a [TerminalSettings](https://six-tim.github.io/timapi/doc/java/doc/com/six/timapi/TerminalSettings.html) object
2. The config previously read from the TimApi.cfg file can be overwritten by hand using setter methods from the [TerminalSettings](https://six-tim.github.io/timapi/doc/java/doc/com/six/timapi/TerminalSettings.html) class.

Table with Configuration File Parameters:

ParameterDescription
LogDirDirectory where log files are generated
LogLevelLogging level, defines how much information will be logged. For detailed values see Logging / LogLevel
LogRetainFileCountDefines how many log files will be kept before deleting (or archiving) the oldest. Logging / Log Rotation Handling
TerminalIdTerminal ID to be broadcasted in case of ConnectionMode Broadcast
ConnectionModeConnection mode used between ECR and EFT. For more information see ConnectionMode
ConnectionIPStringIP address of the EFT terminal in case of ConnectionMode OnFixIP and Websockets.
ConnectionIPPortListening Port of the EFT terminal in case of ConnectionMode OnFixIP and Websockets.
SerialPortSerial port to be used for serial connection in case of ConnectionMode Serial.
SerialBaudrateBaudrate used in case of ConnectionMode Serial.
ProtocolTypeProtocol type. For detailed values see ProtocolType.
FetchBrandsAutomatically retrieves application information during logging in. Default is on (value "On" or "Off")
AutoCommitAfter executing the Transaction- function the API commits the transaction automatically. Default is on (value "On" or "Off")
RequestRepetitionDefines how many times a Commit or Rollback request is sent repeatedly, if the original request has been lost. (Default = 0, means disabled = no repetition)
EnableKeepAliveDefines if KeepAlive functionality shall be enabled or not. Default is on (value "On" or "Off").
SecuredConnectionDefines if the TCP/IP or Websocket connection shall be secured using TLS. Default is off (value "On" or "Off").

The TimApi.cfg file has to be placed in the working directory used when the java process is launched. Set the working directory accordingly for running your application to make sure TimApi.cfg is found.

Example "TimApi.cfg": This example describes the TimApi.cfg file with a global ini-section and two different ini-sections for specific DeviceIds:

[global]
ProtocolType = SIXml
TerminalId = 21001234
LogDir = var/log

[MyDeviceId]
ProtocolType = SIXml
TerminalId = 12345678
LogDir = var/otherLog

[MySecondDeviceId]
ProtocolType = SIXml
TerminalId = 87654321
LogDir = var/yetAnotherLog
ConnectionMode = OnFixIp
ConnectionIPString = 192.168.1.13