Select your printer model

Parameters are refined by the selected printer.

connect method


Starts communication with the printer.

Syntax

 
connect(ipAddress, port, callback);
 
connect(ipAddress, port, callback, options);

Parameter

ipAddress

Value

Description

ipAddress

Specifies the IP address of the printer.

port

Specifies the communication method.

Value

Description

8008

HTTP communication

8043

SSL/TLS communication

callback

Specifies a callback function to receive the execution result. One of the following strings is passed to the first parameter to indicate the result.

String

Description

"OK"

Connection via HTTP communication has been successful when the ePOS-Print option is enabled or not enabled.

"SSL_CONNECT_OK"

Connection via SSL/TLS communication has been successful when the ePOS-Print option is not enabled.

"ERROR_TIMEOUT"

Timeout occurred.

"ERROR_PARAMETER"

A parameter error occurred.

options

Specifies properties using object literals.

Property

Description

true/false

eposprint

Specifies whether or not to enable the ePOS-Print option.

true: Enables the option.

false: Disables the option.

Enable the ePOS-Print option in the system configuration of the TM printer model and customer display model.

Disable the ePOS-Print option in the system configuration of TM Printer + DM-D + barcode scanner model and POS terminal model. When the ePOS-Print option is enabled, the peripheral devices other than the slave printers and customer display can no longer be controlled.

Example

 
connect("192.168.192.168", "8008", callback, {"eposprint" : true});

Supplementary explanation

  • For the syntax to specify the options, refer to Epson ePOS SDK for JavaScript User's Manual.
  • This API will succeed regardless of the connection status of the TM printer (master) and peripheral devices.
  • For continuous processing, or for controlling the printer from a single terminal, it is recommended to keep the application connected with the devices.
  • If the options parameter is omitted, "false: disabled" will be specified.
  • When connection has failed while the ePOS-Print option is not enabled, enable the ePOS-Print option and make the connection.
    When this connection is successful, "OK" is passed to the callback parameter regardless of the communication method specified in the port parameter.
  • When the eposprint option is enabled by specifying 8043 in the port parameter and true in the options parameter, "OK" is returned to the callback parameter.
  • When the eposprint option is enabled by specifying true in the options parameter, the methods that can be used in the ePOSDevice object are as follows.
  • When using the Automatic certificate update feature, set the host name to the ipAddress.
    The host name is generated by converting the serial number of the printer.
    Refer to the sample program for information on the conversion method.
    Select "8043" as the port.
    The Automatic certificate update feature is only supported by some TM printers. To find out if this function is available for the TM printer you are using, refer to the "Application Development Information" chapter of the Technical Reference Guide for that TM printer.
 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

Epson ePOS SDK includes patented or patent pending functions. The contents must not be disclosed to third parties.


Epson ePOS SDK for JavaScript

Jump to the top