com.esf.net.termserv.service
Interface ITermServService


public interface ITermServService

The ITermServService is used to give from one to eight network clients access to one or more serial ports or a single parallel printer port. If more than two or more client are simultaneously accessing a serial port then the TermServ should be in half duplex so that resource protection can be used on the serial port.

Author:
john.lujan

Field Summary
static java.lang.String BROADCAST
           
static java.lang.String DATATBITS_5
           
static java.lang.String DATATBITS_6
           
static java.lang.String DATATBITS_7
           
static java.lang.String DATATBITS_8
           
static java.lang.String FULL_DUPLEX
           
static java.lang.String HALF_DUPLEX
           
static java.lang.String NO_MODBUS
           
static java.lang.String OPENMODBUS_TO_ASCII
           
static java.lang.String OPENMODBUS_TO_RTU
           
static java.lang.String PARALLEL_LP_DRIVER
           
static java.lang.String PARALLEL_USB_LP_DRIVER
           
static java.lang.String PARITY_EVEN
           
static java.lang.String PARITY_MARK
           
static java.lang.String PARITY_NONE
           
static java.lang.String PARITY_ODD
           
static java.lang.String PARITY_SPACE
           
static java.lang.String SERIAL_ACM_DRIVER
           
static java.lang.String SERIAL_CUSTOM_DRIVER
           
static java.lang.String SERIAL_LINUX_DRIVER
           
static java.lang.String SERIAL_USB_DRIVER
           
static java.lang.String SERIAL_VIRTUALPAIR_DRIVER
           
static java.lang.String SERVICE_NAME
          Reports the class name representing this interface.
static java.lang.String STOPBITS_1
           
static java.lang.String STOPBITS_2
           
 
Method Summary
 void changeTermServBufferSize(int TermServId, int BufferSize)
          This method modifies the BufferSize of a previously created TermServ.
 void changeTermServDefragTimerMsec(int TermServId, int DefragTimerMsec)
          This method is used to modify the Defragmentation timer of a previously created TermServ.
 void changeTermServDemarkationMsec(int TermServId, int DemarkationMsec)
          This method is used to modify the Demarkation timer of a previously created TermServ.
 void changeTermServIdleTimerSeconds(int TermServId, int IdleTimerSeconds)
          This method is used to modify the ResponseTimeout timer for a previously created TermServ.
 void changeTermServListeningPort(int TermServId, int ListeningPort)
          This method modifies the network listening port number for a previously created TermServ.
 void changeTermServMaxAcceptedSockets(int TermServId, int MaxAcceptedSockets)
          This method modifies the Maximum number of active connections on the ListeningPort can be serviced simultaneously.
 void changeTermServOpenModbusMode(int TermServId, java.lang.String OpenModbusMode)
          This method is used to modify the OpenModbus operation of a previously created TermServ.
 void changeTermServOperation(int TermServId, java.lang.String sOperation)
          This method is used to modify the operation mode of a previously created TermServ.
 void changeTermServParallelPortDeviceDriver(int TermservId, java.lang.String DeviceDriver)
          This method can change the DeviceDriver used to communicate with a previously created TermServParallelPort.
 void changeTermServParallelPortEndDeviceIndex(int TermservId, int EndDeviceIndex)
          This method can change the EndDeviceIndex used to communicate with a previously created TermServParallelPort.
 void changeTermServPassword(int TermServId, java.lang.String Password)
          This method modifies the Password for a previously created TermServ.
 void changeTermServPrintServer(int TermServId, boolean PrintServer)
          This method is used to modify the PrintServer mode of a previously created TermServ.
 void changeTermServResponseTimeoutMsec(int TermServId, int ResponseTimeoutMsec)
          This method is used to modify the ResponseTimeout timer of a previously created TermServ.
 void changeTermServSerialPortBaudRate(int TermServId, int SerialIndex, int BaudRate)
          This method changes the BaudRate for a previously created TermServSerialPort.
 void changeTermServSerialPortCancelEchoChars(int TermServId, int SerialIndex, boolean CancelEchoChars)
          This method modifies the CancelEchoChars for a previously created TermServSerialPort.
 void changeTermServSerialPortDataBits(int TermServId, int SerialIndex, java.lang.String DataBits)
          This method modifies the DataBits for a previously created TermServSerialPort.
 void changeTermServSerialPortDeviceDriver(int TermServId, int SerialIndex, java.lang.String DeviceDriver)
          This method changes the DeviceDriver for a previously created TermServSerialPort.
 void changeTermServSerialPortEndDeviceIndex(int TermServId, int SerialIndex, int EndDeviceIndex)
          This method changes the DeviceDriver for a previously created TermServSerialPort
 void changeTermServSerialPortParity(int TermServId, int SerialIndex, java.lang.String Parity)
          This method changes the Parity for a previously created TermServSerialPort.
 void changeTermServSerialPortStopBits(int TermServId, int SerialIndex, java.lang.String StopBits)
          This method modifies the StopBits for a previously created TermServSerialPort.
 void changeTermServSerialPortWarmDownMsec(int TermServId, int SerialIndex, int WarmDownMsec)
          This method changes the WarmDownMsec timer for a previously created TermServSerialPort.
 void changeTermServSerialPortWarmUpMsec(int TermServId, int SerialIndex, int WarmUpMsec)
          This method changes the WarmUpMsec timer for a previously created TermServSerialPort.
 int createTermServ(int iListeningPort, int iMaxAcceptedSockets, java.lang.String sOperation, boolean fPrintServer, java.lang.String OpenModbusMode, int iDemarkationMsec, int iResponseTimeoutMsec, int iIdleTimerSeconds, int iDefragTimerMsec, int iBufferSize, java.lang.String sPassword)
          Configure operating parameters for Terminal Server minus the end device(s) parameters which use another method
 void createTermServParallelPort(int iTermServId, java.lang.String sDeviceDriver, int iEndDeviceIndex)
          This method adds a parallel port to the Terminal Server.
 int createTermServSerialPort(int iTermServId, java.lang.String sDeviceDriver, int iEndDeviceIndex, int iBaudRate, java.lang.String sParity, java.lang.String sStopBits, java.lang.String sDataBits, int iWarmUpMSec, int iWarmDownMSec, boolean fCancelEchoChars)
          This method adds a serial port to the Terminal Server.
 void deleteTermServEndDevice(int iTermServId, java.lang.String deviceDriver, int iEndDeviceIndex)
          This method will eliminate one of the attached end devices that was created for the selected (iTermServId) Terminal Servers.
 int getTermServBufferSize(int TermServId)
          This method returns the BufferSize of a previously created TermServ.
 int getTermServCount()
          Get the current count of configured Terminal Servers
 int getTermServDefragTimerMsec(int TermServId)
          This method returns the Defragmentation timer of a previously created TermServ in seconds.
 int getTermServDemarkationMsec(int TermServId)
          This method returns the Demarkation timer of a previously created TermServ in milliseconds.
 int getTermServEndDeviceCount(int iTermServId)
          This method will return the count of end devices added to a select Terminal Server (without guessing)
 java.lang.String[] getTermServEndDeviceNames(int iTermServId)
          This function returns an array of Strings.
 int getTermServIdleTimerSeconds(int TermServId)
          This method returns the ResponseTimeout timer for a previously created TermServ in milliseconds.
 int getTermServListeningPort(int TermServId)
          This method returns the network listening port number for a previously created TermServ.
 int getTermServMaxAcceptedSockets(int TermServId)
          This method returns the Maximum number of active connections on the ListeningPort can be serviced simultaneously.
 java.lang.String getTermServOpenModbusMode(int TermServId)
          This method returns the OpenModbus operation of a previously created TermServ.
 java.lang.String getTermServOperation(int TermServId)
          This method is returns the operation mode of a previously created TermServ.
 java.lang.String getTermServParallelPortDeviceDriver(int TermservId)
          This method returns DeviceDriver string used to communicate with a previously created TermServParallelPort.
 int getTermServParallelPortEndDeviceIndex(int TermservId)
          This method returns the EndDeviceIndex used to communicate with a previously created TermServParallelPort.
 java.lang.String getTermServPassword(int TermServId)
          This method returns the Password for a previously created TermServ.
 boolean getTermServPrintServer(int TermServId)
          This method is used to return the PrintServer mode of a previously created TermServ.
 int getTermServResponseTimeoutMsec(int TermServId)
          This method returns the ResponseTimeout timer of a previously created TermServ in milliseconds.
 int getTermServSerialPortBaudRate(int TermServId, int SerialIndex)
          This method returns the BaudRate for a previously created TermServSerialPort.
 boolean getTermServSerialPortCancelEchoChars(int TermServId, int SerialIndex)
          This method returns the CancelEchoChars flag for a previously created TermServSerialPort.
 java.lang.String getTermServSerialPortDataBits(int TermServId, int SerialIndex)
          This method returns the DataBits string for a previously created TermServSerialPort.
 java.lang.String getTermServSerialPortDeviceDriver(int TermServId, int SerialIndex)
          This method returns the DeviceDriver string for a previously created TermServSerialPort.
 int getTermServSerialPortEndDeviceIndex(int TermServId, int SerialIndex)
          This method returns the EndDeviceIndex for a previously created TermServSerialPort
 java.lang.String getTermServSerialPortParity(int TermServId, int SerialIndex)
          This method returns the Parity string for a previously created TermServSerialPort.
 java.lang.String getTermServSerialPortStopBits(int TermServId, int SerialIndex)
          This method returns the StopBits string for a previously created TermServSerialPort.
 int getTermServSerialPortWarmDownMsec(int TermServId, int SerialIndex)
          This method returns the WarmDownMsec timer limit for a previously created TermServSerialPort.
 int getTermServSerialPortWarmUpMsec(int TermServId, int SerialIndex)
          This method returns the WarmUpMsec timer limit for a previously created TermServSerialPort.
 void startTermServInstance(int iTermServId)
          This method will attempt to start a new instance of Terminal Server using the appropriate configuration parameters.
 void stopTermServInstance(int iTermServId)
          This method will attempt to stop a previously running instance of Terminal Server.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Reports the class name representing this interface.


FULL_DUPLEX

static final java.lang.String FULL_DUPLEX
See Also:
Constant Field Values

HALF_DUPLEX

static final java.lang.String HALF_DUPLEX
See Also:
Constant Field Values

BROADCAST

static final java.lang.String BROADCAST
See Also:
Constant Field Values

OPENMODBUS_TO_RTU

static final java.lang.String OPENMODBUS_TO_RTU
See Also:
Constant Field Values

OPENMODBUS_TO_ASCII

static final java.lang.String OPENMODBUS_TO_ASCII
See Also:
Constant Field Values

NO_MODBUS

static final java.lang.String NO_MODBUS
See Also:
Constant Field Values

SERIAL_LINUX_DRIVER

static final java.lang.String SERIAL_LINUX_DRIVER
See Also:
Constant Field Values

PARALLEL_LP_DRIVER

static final java.lang.String PARALLEL_LP_DRIVER
See Also:
Constant Field Values

PARALLEL_USB_LP_DRIVER

static final java.lang.String PARALLEL_USB_LP_DRIVER
See Also:
Constant Field Values

SERIAL_CUSTOM_DRIVER

static final java.lang.String SERIAL_CUSTOM_DRIVER
See Also:
Constant Field Values

SERIAL_VIRTUALPAIR_DRIVER

static final java.lang.String SERIAL_VIRTUALPAIR_DRIVER
See Also:
Constant Field Values

SERIAL_USB_DRIVER

static final java.lang.String SERIAL_USB_DRIVER
See Also:
Constant Field Values

SERIAL_ACM_DRIVER

static final java.lang.String SERIAL_ACM_DRIVER
See Also:
Constant Field Values

PARITY_NONE

static final java.lang.String PARITY_NONE
See Also:
Constant Field Values

PARITY_EVEN

static final java.lang.String PARITY_EVEN
See Also:
Constant Field Values

PARITY_ODD

static final java.lang.String PARITY_ODD
See Also:
Constant Field Values

PARITY_MARK

static final java.lang.String PARITY_MARK
See Also:
Constant Field Values

PARITY_SPACE

static final java.lang.String PARITY_SPACE
See Also:
Constant Field Values

STOPBITS_1

static final java.lang.String STOPBITS_1
See Also:
Constant Field Values

STOPBITS_2

static final java.lang.String STOPBITS_2
See Also:
Constant Field Values

DATATBITS_5

static final java.lang.String DATATBITS_5
See Also:
Constant Field Values

DATATBITS_6

static final java.lang.String DATATBITS_6
See Also:
Constant Field Values

DATATBITS_7

static final java.lang.String DATATBITS_7
See Also:
Constant Field Values

DATATBITS_8

static final java.lang.String DATATBITS_8
See Also:
Constant Field Values
Method Detail

getTermServCount

int getTermServCount()
Get the current count of configured Terminal Servers

Returns:
number of terminal servers

createTermServ

int createTermServ(int iListeningPort,
                   int iMaxAcceptedSockets,
                   java.lang.String sOperation,
                   boolean fPrintServer,
                   java.lang.String OpenModbusMode,
                   int iDemarkationMsec,
                   int iResponseTimeoutMsec,
                   int iIdleTimerSeconds,
                   int iDefragTimerMsec,
                   int iBufferSize,
                   java.lang.String sPassword)
                   throws java.lang.Exception
Configure operating parameters for Terminal Server minus the end device(s) parameters which use another method

Parameters:
iListeningPort - TCP/IP Port that TermServ will listen on. OpenModbus uses port 512. User ports > 1024. This is also used as a unique key so if you access this method with same port then same object will get reused.
iMaxAcceptedSockets - Number of active Terminal Servers allowed on the same TCP port from 1 to 8. If set to 1 then the port will be pre-emptive.
sOperation - Use the service.FULL_DUPLEX for normal Terminal server operation. This mode should only be used in pre-emptive mode. service.HALF_DUPLEX will allow multiple Clients to access the same end device(s) using resource protection. service.BROADCAST will send data to end device and will never receive anything from end device(s).
fPrintServer - If 'true' then attempt to guarantee that all bytes are sent to end device(s) even if pending bytes are in buffer and the socket closes.
OpenModbusMode - Use service.OPENMODBUS_TO_RTU for conversion from OpenModbus-TCP packet to RTU Modbus at the end device(s). Use service.OPENMODBUS_TO_ASCII for conversion from OpenModbus-TCP to ASCII Modbus at the end device(s). Otherwise use "" or service.NO_MODBUS
iDemarkationMsec - This is used to determine when to stop building a payload of end device bytes and forward any previously received bytes to the TCP client in milliseconds.
iResponseTimeoutMsec - This configures the Terminal Server running in HALF_DUPLEX mode how long to wait for the first byte before releasing the end devices resource(s) upon receiving no data.
iIdleTimerSeconds - The Terminal Server will close the connection to the Client if no traffic is detecting after this period of seconds. Use a value of zero to instruct the Terminal Server to ignore any inactivity.
iDefragTimerMsec - This is used help the Terminal Server reconstruct any fragmented message from the Client so that it can be reassembled into a single packet before sending it to the end device(s).
iBufferSize - This is the maximum number of bytes that are to received from either the Client or the end device. If the buffer gets full then it is immediately returned to the other side of the Terminal Server.
sPassword - If this parameter is empty ("") then a password will not be required before the Terminal Server will allow access to the end device(s). The maximum string length is 16 characters. The client has 60 seconds to correctly enter the password.
Returns:
int iTermServId This is the index to reference the object created by this configuration.
Throws:
java.lang.Exception

changeTermServListeningPort

void changeTermServListeningPort(int TermServId,
                                 int ListeningPort)
                                 throws java.lang.Exception
This method modifies the network listening port number for a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
ListeningPort - This is the new network port number to be used for that selected TermServ.
Throws:
java.lang.Exception

changeTermServMaxAcceptedSockets

void changeTermServMaxAcceptedSockets(int TermServId,
                                      int MaxAcceptedSockets)
                                      throws java.lang.Exception
This method modifies the Maximum number of active connections on the ListeningPort can be serviced simultaneously.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
MaxAcceptedSockets - This is new Maximum number of simultaneous connections on a listening socket.
Throws:
java.lang.Exception

changeTermServOperation

void changeTermServOperation(int TermServId,
                             java.lang.String sOperation)
                             throws java.lang.Exception
This method is used to modify the operation mode of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
sOperation - Use the service.FULL_DUPLEX for normal Terminal server operation. This mode should only be used in pre-emptive mode. service.HALF_DUPLEX will allow multiple Clients to access the same end device(s) using resource protection. service.BROADCAST will send data to end device and will never receive anything from end device(s).
Throws:
java.lang.Exception

changeTermServPrintServer

void changeTermServPrintServer(int TermServId,
                               boolean PrintServer)
                               throws java.lang.Exception
This method is used to modify the PrintServer mode of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
PrintServer - If 'true' then attempt to guarantee that all bytes are sent to end device(s) even if pending bytes are in buffer and the socket closes.
Throws:
java.lang.Exception

changeTermServOpenModbusMode

void changeTermServOpenModbusMode(int TermServId,
                                  java.lang.String OpenModbusMode)
                                  throws java.lang.Exception
This method is used to modify the OpenModbus operation of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
OpenModbusMode - Use service.OPENMODBUS_TO_RTU for conversion from OpenModbus-TCP packet to RTU Modbus at the end device(s). Use service.OPENMODBUS_TO_ASCII for conversion from OpenModbus-TCP to ASCII Modbus at the end device(s). Otherwise use "" or service.NO_MODBUS
Throws:
java.lang.Exception

changeTermServDemarkationMsec

void changeTermServDemarkationMsec(int TermServId,
                                   int DemarkationMsec)
                                   throws java.lang.Exception
This method is used to modify the Demarkation timer of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
DemarkationMsec - This is used to determine when to stop building a payload of end device bytes and forward any previously received bytes to the TCP client in milliseconds.
Throws:
java.lang.Exception

changeTermServResponseTimeoutMsec

void changeTermServResponseTimeoutMsec(int TermServId,
                                       int ResponseTimeoutMsec)
                                       throws java.lang.Exception
This method is used to modify the ResponseTimeout timer of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
ResponseTimeoutMsec - This configures the Terminal Server running in HALF_DUPLEX mode how long to wait for the first byte before releasing the end devices resource(s) upon receiving no data.
Throws:
java.lang.Exception

changeTermServIdleTimerSeconds

void changeTermServIdleTimerSeconds(int TermServId,
                                    int IdleTimerSeconds)
                                    throws java.lang.Exception
This method is used to modify the ResponseTimeout timer for a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
IdleTimerSeconds - The Terminal Server will close the connection to the Client if no traffic is detecting after this period of seconds. Use a value of zero to instruct the Terminal Server to ignore any inactivity.
Throws:
java.lang.Exception

changeTermServDefragTimerMsec

void changeTermServDefragTimerMsec(int TermServId,
                                   int DefragTimerMsec)
                                   throws java.lang.Exception
This method is used to modify the Defragmentation timer of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
DefragTimerMsec - This is used help the Terminal Server reconstruct any fragmented message from the Client so that it can be reassembled into a single packet before sending it to the end device(s).
Throws:
java.lang.Exception

changeTermServBufferSize

void changeTermServBufferSize(int TermServId,
                              int BufferSize)
                              throws java.lang.Exception
This method modifies the BufferSize of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
BufferSize - This is the maximum number of bytes that are to be received from either the Client or the end device. If the buffer gets full then it is immediately returned to the other side of the Terminal Server.
Throws:
java.lang.Exception

changeTermServPassword

void changeTermServPassword(int TermServId,
                            java.lang.String Password)
                            throws java.lang.Exception
This method modifies the Password for a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Password - If this parameter is empty ("") then a password will not be required before the Terminal Server will allow access to the end device(s). The maximum string length is 16 characters. The client has 60 seconds to correctly enter the password.
Throws:
java.lang.Exception

getTermServListeningPort

int getTermServListeningPort(int TermServId)
                             throws java.lang.Exception
This method returns the network listening port number for a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
ListeningPort
Throws:
java.lang.Exception

getTermServMaxAcceptedSockets

int getTermServMaxAcceptedSockets(int TermServId)
                                  throws java.lang.Exception
This method returns the Maximum number of active connections on the ListeningPort can be serviced simultaneously.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
MaxAcceptedSockets
Throws:
java.lang.Exception

getTermServOperation

java.lang.String getTermServOperation(int TermServId)
                                      throws java.lang.Exception
This method is returns the operation mode of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
sOperation "FULL_DUPLEX", "HALF_DUPLEX" or "BROADCAST".
Throws:
java.lang.Exception

getTermServPrintServer

boolean getTermServPrintServer(int TermServId)
                               throws java.lang.Exception
This method is used to return the PrintServer mode of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
PrintServer If 'true' then it guarantees that all bytes are sent to end device(s) even if pending bytes are in buffer and the socket closes.
Throws:
java.lang.Exception

getTermServOpenModbusMode

java.lang.String getTermServOpenModbusMode(int TermServId)
                                           throws java.lang.Exception
This method returns the OpenModbus operation of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
OpenModbusMode "OPENMODBUS_TO_RTU" indicates conversion from OpenModbus-TCP packet to RTU Modbus at the end device(s). "OPENMODBUS_TO_ASCII" indicates conversion from OpenModbus-TCP to ASCII Modbus at the end device(s). Otherwise "NO_MODBUS".
Throws:
java.lang.Exception

getTermServDemarkationMsec

int getTermServDemarkationMsec(int TermServId)
                               throws java.lang.Exception
This method returns the Demarkation timer of a previously created TermServ in milliseconds.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
DemarkationMsec This determines when to stop building a payload of end device bytes and forward any previously received bytes to the TCP client in milliseconds.
Throws:
java.lang.Exception

getTermServResponseTimeoutMsec

int getTermServResponseTimeoutMsec(int TermServId)
                                   throws java.lang.Exception
This method returns the ResponseTimeout timer of a previously created TermServ in milliseconds.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
ResponseTimeoutMsec This configures the Terminal Server running in HALF_DUPLEX mode how long to wait for the first byte before releasing the end devices resource(s) upon receiving no data.
Throws:
java.lang.Exception

getTermServIdleTimerSeconds

int getTermServIdleTimerSeconds(int TermServId)
                                throws java.lang.Exception
This method returns the ResponseTimeout timer for a previously created TermServ in milliseconds.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
IdleTimerSeconds The Terminal Server will close the connection to the Client if no traffic is detecting after this period of seconds. Use a value of zero to instruct the Terminal Server to ignore any inactivity.
Throws:
java.lang.Exception

getTermServDefragTimerMsec

int getTermServDefragTimerMsec(int TermServId)
                               throws java.lang.Exception
This method returns the Defragmentation timer of a previously created TermServ in seconds.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
DefragTimerMsec This is used help the Terminal Server reconstruct any fragmented message from the Client so that it can be reassembled into a single packet before sending it to the end device(s).
Throws:
java.lang.Exception

getTermServBufferSize

int getTermServBufferSize(int TermServId)
                          throws java.lang.Exception
This method returns the BufferSize of a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
BufferSize This is the maximum number of bytes that are to be received from either the Client or the end device. If the buffer gets full then it is immediately returned to the other side of the Terminal Server.
Throws:
java.lang.Exception

getTermServPassword

java.lang.String getTermServPassword(int TermServId)
                                     throws java.lang.Exception
This method returns the Password for a previously created TermServ.

Parameters:
TermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
Password If this parameter is empty ("") then a password will not be required before the Terminal Server will allow access to the end device(s). The maximum string length is 16 characters. The client has 60 seconds to correctly enter the password.
Throws:
java.lang.Exception

createTermServSerialPort

int createTermServSerialPort(int iTermServId,
                             java.lang.String sDeviceDriver,
                             int iEndDeviceIndex,
                             int iBaudRate,
                             java.lang.String sParity,
                             java.lang.String sStopBits,
                             java.lang.String sDataBits,
                             int iWarmUpMSec,
                             int iWarmDownMSec,
                             boolean fCancelEchoChars)
                             throws java.lang.Exception
This method adds a serial port to the Terminal Server. More than one serial port can be added.

Parameters:
iTermServId - This should be on of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
sDeviceDriver - This is the device driver used for the end device. Use service.SERIAL_LINUX_DRIVER if you want to use the native Linux serial port (e.g. /dev/ttyS[0-12]). Use service.SERIAL_CUSTOM_DRIVER if you want to use the EuroTech custom serial driver (e.g. /dev/acscomm[0-36]) Use service.SERIAL_USB_DRIVER if you want to use the native Linux driver usb serial ports (e.g. /dev/ttyUSB[0-8]).
iEndDeviceIndex - This is the index that is appended to the root device name such as /dev/ttyS? /dev/acscomm? or in the case of virtual serial ports add 64 to /dev/acscomm and the pairs would be [0,1], [2,3], [4,5] etc...
iBaudRate - This is the baud rate to be used on the serial device. Valid entries are... 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200.
sParity - This is the parity to be used on the serial port. Valid entries could be... service.PARITY_NONE, service.PARITY_EVEN, service.PARITY_ODD, service.PARITY_MARK, service.PARITY_SPACE, and that's all folks.
sStopBits - This is the number of stop bits to be used on the serial device and can only be... service.STOPBITS_1 or service.STOPBITS_2.
sDataBits - This is the number of data bits in a character for the end devices. Valid entries... service.DATABITS_5 or service.DATABITS_6 or service.DATABITS_7 or service.DATABITS_8
iWarmUpMSec - This is the number of milliseconds used after raising RTS before sending a payload to the serial port.. If set to 0 then nothing is sent until CTS is true. If it is set to -1 then no handshaking is used on the serial port. Only available when using the SERIAL_CUSTOM_DRIVER.
iWarmDownMSec - This is the number of milliseconds to delay lowering RTS after the last byte leaves the serial port. Only available with the SERIAL_CUSTOM_DRIVER.
fCancelEchoChars - This will configure the serial port to not accept any bytes while it is transmitting. Only available with SERIAL_CUSTOM_DRIVER.
Returns:
SerialPortId This is needed to identify a serial port in the deleteTermServEndDevice() method.
Throws:
java.lang.Exception

changeTermServSerialPortDeviceDriver

void changeTermServSerialPortDeviceDriver(int TermServId,
                                          int SerialIndex,
                                          java.lang.String DeviceDriver)
                                          throws java.lang.Exception
This method changes the DeviceDriver for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
DeviceDriver - This is the device driver used for the end device. Use service.SERIAL_LINUX_DRIVER if you want to use the native Linux serial port (e.g. /dev/ttyS[0-12]). Use service.SERIAL_CUSTOM_DRIVER if you want to use the EuroTech custom serial driver (e.g. /dev/acscomm[0-36]) Use service.SERIAL_USB_DRIVER if you want to use the native Linux driver usb serial ports (e.g. /dev/ttyUSB[0-8]).
Throws:
java.lang.Exception

changeTermServSerialPortEndDeviceIndex

void changeTermServSerialPortEndDeviceIndex(int TermServId,
                                            int SerialIndex,
                                            int EndDeviceIndex)
                                            throws java.lang.Exception
This method changes the DeviceDriver for a previously created TermServSerialPort

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
EndDeviceIndex - This is the index that is appended to the root device name such as /dev/ttyS? /dev/acscomm? or in the case of virtual serial ports add 64 to /dev/acscomm and the pairs would be [0,1], [2,3], [4,5] etc...
Throws:
java.lang.Exception

changeTermServSerialPortBaudRate

void changeTermServSerialPortBaudRate(int TermServId,
                                      int SerialIndex,
                                      int BaudRate)
                                      throws java.lang.Exception
This method changes the BaudRate for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
BaudRate - This is the baud rate to be used on the serial device. Valid entries are... 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200.
Throws:
java.lang.Exception

changeTermServSerialPortParity

void changeTermServSerialPortParity(int TermServId,
                                    int SerialIndex,
                                    java.lang.String Parity)
                                    throws java.lang.Exception
This method changes the Parity for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Parity - This is the parity to be used on the serial port. Valid entries could be... service.PARITY_NONE, service.PARITY_EVEN, service.PARITY_ODD, service.PARITY_MARK, service.PARITY_SPACE, and that's all folks.
Throws:
java.lang.Exception

changeTermServSerialPortStopBits

void changeTermServSerialPortStopBits(int TermServId,
                                      int SerialIndex,
                                      java.lang.String StopBits)
                                      throws java.lang.Exception
This method modifies the StopBits for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
StopBits - This is the number of stop bits to be used on the serial device and can only be... service.STOPBITS_1 or service.STOPBITS_2.
Throws:
java.lang.Exception

changeTermServSerialPortDataBits

void changeTermServSerialPortDataBits(int TermServId,
                                      int SerialIndex,
                                      java.lang.String DataBits)
                                      throws java.lang.Exception
This method modifies the DataBits for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
DataBits - This is the number of data bits in a character for the end devices. Valid entries... service.DATABITS_5 or service.DATABITS_6 or service.DATABITS_7 or service.DATABITS_8
Throws:
java.lang.Exception

changeTermServSerialPortWarmUpMsec

void changeTermServSerialPortWarmUpMsec(int TermServId,
                                        int SerialIndex,
                                        int WarmUpMsec)
                                        throws java.lang.Exception
This method changes the WarmUpMsec timer for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
WarmUpMsec - This is the number of milliseconds used after raising RTS before sending a payload to the serial port.. If set to 0 then nothing is sent until CTS is true. If it is set to -1 then no handshaking is used on the serial port. Only available when using the SERIAL_CUSTOM_DRIVER.
Throws:
java.lang.Exception

changeTermServSerialPortWarmDownMsec

void changeTermServSerialPortWarmDownMsec(int TermServId,
                                          int SerialIndex,
                                          int WarmDownMsec)
                                          throws java.lang.Exception
This method changes the WarmDownMsec timer for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
WarmDownMsec - This is the number of milliseconds to delay lowering RTS after the last byte leaves the serial port. Only available with hte SERIAL_CUSTOM_DRIVER.
Throws:
java.lang.Exception

changeTermServSerialPortCancelEchoChars

void changeTermServSerialPortCancelEchoChars(int TermServId,
                                             int SerialIndex,
                                             boolean CancelEchoChars)
                                             throws java.lang.Exception
This method modifies the CancelEchoChars for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
CancelEchoChars - This will configure the serial port to not accept any bytes while it is transmitting. Only available with SERIAL_CUSTOM_DRIVER.
Throws:
java.lang.Exception

getTermServSerialPortDeviceDriver

java.lang.String getTermServSerialPortDeviceDriver(int TermServId,
                                                   int SerialIndex)
                                                   throws java.lang.Exception
This method returns the DeviceDriver string for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
DeviceDriver "SERIAL_LINUX_DRIVER" or "SERIAL_CUSTOM_DRIVER" or "SERIAL_USB_DRIVER"
Throws:
java.lang.Exception

getTermServSerialPortEndDeviceIndex

int getTermServSerialPortEndDeviceIndex(int TermServId,
                                        int SerialIndex)
                                        throws java.lang.Exception
This method returns the EndDeviceIndex for a previously created TermServSerialPort

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
EndDeviceIndex This is the index that is appended to the root device name such as /dev/ttyS? /dev/acscomm? or in the case of virtual serial ports add 64 to /dev/acscomm and the pairs would be [0,1], [2,3], [4,5] etc...
Throws:
java.lang.Exception

getTermServSerialPortBaudRate

int getTermServSerialPortBaudRate(int TermServId,
                                  int SerialIndex)
                                  throws java.lang.Exception
This method returns the BaudRate for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
BaudRate This is the baud rate to be used on the serial device. Valid entries are... 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200.
Throws:
java.lang.Exception

getTermServSerialPortParity

java.lang.String getTermServSerialPortParity(int TermServId,
                                             int SerialIndex)
                                             throws java.lang.Exception
This method returns the Parity string for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
Parity "PARITY_NONE" or "PARITY_EVEN" or "PARITY_ODD" or "PARITY_MARK" or "PARITY_SPACE"
Throws:
java.lang.Exception

getTermServSerialPortStopBits

java.lang.String getTermServSerialPortStopBits(int TermServId,
                                               int SerialIndex)
                                               throws java.lang.Exception
This method returns the StopBits string for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
StopBits "STOPBITS_1" or "STOPBITS_2"
Throws:
java.lang.Exception

getTermServSerialPortDataBits

java.lang.String getTermServSerialPortDataBits(int TermServId,
                                               int SerialIndex)
                                               throws java.lang.Exception
This method returns the DataBits string for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
DataBits "DATABITS_5" or"DATABITS_6" or"DATABITS_7" or"DATABITS_8"
Throws:
java.lang.Exception

getTermServSerialPortWarmUpMsec

int getTermServSerialPortWarmUpMsec(int TermServId,
                                    int SerialIndex)
                                    throws java.lang.Exception
This method returns the WarmUpMsec timer limit for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
WarmUpMsec This is the number of milliseconds used after raising RTS before sending a payload to the serial port.. If set to 0 then nothing is sent until CTS is true. If it is set to -1 then no handshaking is used on the serial port. Only available when using the SERIAL_CUSTOM_DRIVER.
Throws:
java.lang.Exception

getTermServSerialPortWarmDownMsec

int getTermServSerialPortWarmDownMsec(int TermServId,
                                      int SerialIndex)
                                      throws java.lang.Exception
This method returns the WarmDownMsec timer limit for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
WarmDownMsec This is the number of milliseconds to delay lowering RTS after the last byte leaves the serial port. Only available with hte SERIAL_CUSTOM_DRIVER.
Throws:
java.lang.Exception

getTermServSerialPortCancelEchoChars

boolean getTermServSerialPortCancelEchoChars(int TermServId,
                                             int SerialIndex)
                                             throws java.lang.Exception
This method returns the CancelEchoChars flag for a previously created TermServSerialPort.

Parameters:
TermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
SerialIndex - The record number index returned by createTermServSerialPort() for a selected SerialPort.
Returns:
CancelEchoChars This will configure the serial port to not accept any bytes while it is transmitting. Only available with SERIAL_CUSTOM_DRIVER.
Throws:
java.lang.Exception

createTermServParallelPort

void createTermServParallelPort(int iTermServId,
                                java.lang.String sDeviceDriver,
                                int iEndDeviceIndex)
                                throws java.lang.Exception
This method adds a parallel port to the Terminal Server. Only one parallel port can be added.

Parameters:
iTermServId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
sDeviceDriver - This is the device driver used for the end device. Use service.PARALLEL_LP_DRIVER is you want to use the native Linux parallel port driver (e.g. /dev/lp[0-3]). Use the service.PARALLEL_USB_LP_DRIVER if you want to user the native Linux usb parallel port driver (e.g. /dev/usb/lp[0-3]).
iEndDeviceIndex - This is the index that is appended to the root device name such as.. /dev/lp? /dev/usb/lp? ...
Throws:
java.lang.Exception

changeTermServParallelPortDeviceDriver

void changeTermServParallelPortDeviceDriver(int TermservId,
                                            java.lang.String DeviceDriver)
                                            throws java.lang.Exception
This method can change the DeviceDriver used to communicate with a previously created TermServParallelPort.

Parameters:
TermservId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
DeviceDriver - This is the device driver used for the end device. Use service.PARALLEL_LP_DRIVER is you want to use the native Linux parallel port driver (e.g. /dev/lp[0-3]). Use the service.PARALLEL_USB_LP_DRIVER if you want to user the native Linux usb parallel port driver (e.g. /dev/usb/lp[0-3]).
Throws:
java.lang.Exception

changeTermServParallelPortEndDeviceIndex

void changeTermServParallelPortEndDeviceIndex(int TermservId,
                                              int EndDeviceIndex)
                                              throws java.lang.Exception
This method can change the EndDeviceIndex used to communicate with a previously created TermServParallelPort.

Parameters:
TermservId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
EndDeviceIndex - This is the index that is appended to the root device name such as.. /dev/lp? /dev/usb/lp? ...
Throws:
java.lang.Exception

getTermServParallelPortDeviceDriver

java.lang.String getTermServParallelPortDeviceDriver(int TermservId)
                                                     throws java.lang.Exception
This method returns DeviceDriver string used to communicate with a previously created TermServParallelPort.

Parameters:
TermservId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
DeviceDriver This is the device driver used for the end device. "PARALLEL_LP_DRIVER" if it is using the native Linux parallel port driver (e.g. /dev/lp[0-3]). "PARALLEL_USB_LP_DRIVER" if it is using the native Linux usb parallel port driver (e.g. /dev/usb/lp[0-3]).
Throws:
java.lang.Exception

getTermServParallelPortEndDeviceIndex

int getTermServParallelPortEndDeviceIndex(int TermservId)
                                          throws java.lang.Exception
This method returns the EndDeviceIndex used to communicate with a previously created TermServParallelPort.

Parameters:
TermservId - This should be one of the Id's that is returned by the createTermServ() method. This value ranges from 0 to 'last TermServ Id'
Returns:
EndDeviceIndex This is the index that is appended to the root device name such as.. /dev/lp? /dev/usb/lp? ...
Throws:
java.lang.Exception

getTermServEndDeviceCount

int getTermServEndDeviceCount(int iTermServId)
                              throws java.lang.Exception
This method will return the count of end devices added to a select Terminal Server (without guessing)

Parameters:
iTermServId - This is the index (or you could call it a handle) that is returned by the createTermServ() method.
Throws:
java.lang.Exception

getTermServEndDeviceNames

java.lang.String[] getTermServEndDeviceNames(int iTermServId)
                                             throws java.lang.Exception
This function returns an array of Strings. The name(s) of each end device will be in the list such as... "/dev/ttyS1" and/or "/dev/usb/lp0" and/or "/dev/acscomm11"

Parameters:
iTermServId - This is the index (or handle if you like) that is returned by the createTermServ() method.
Returns:
String[] saDeviceNames such as "/dev/ttyS1" and/or "/dev/usb/lp0" and/or "/dev/acscomm11"
Throws:
java.lang.Exception

deleteTermServEndDevice

void deleteTermServEndDevice(int iTermServId,
                             java.lang.String deviceDriver,
                             int iEndDeviceIndex)
                             throws java.lang.Exception
This method will eliminate one of the attached end devices that was created for the selected (iTermServId) Terminal Servers.

Parameters:
iTermServId - The index for a selected Terminal Server.
deviceDriver - This is one of service.SERIAL_CUSTOM_DRIVER or service.SERIAL_LINUX_DRIVER or service.SERIAL_USB_DRIVER
iEndDeviceIndex - The index for a selected 'end device'.
Throws:
java.lang.Exception

startTermServInstance

void startTermServInstance(int iTermServId)
                           throws java.lang.Exception
This method will attempt to start a new instance of Terminal Server using the appropriate configuration parameters.

Parameters:
iTermServId - This is the handle that was returned by the createTermServ() method.
Throws:
java.lang.Exception

stopTermServInstance

void stopTermServInstance(int iTermServId)
                          throws java.lang.Exception
This method will attempt to stop a previously running instance of Terminal Server.

Parameters:
iTermServId - This is the handle that was returned by the createTermServ() method.
Throws:
java.lang.Exception