88
openPrinter
Starts communication with the printer.
Syntax
public void openPrinter
(int deviceType, String deviceName) throws EposException
Parameter
deviceType : Specifies the type for the device to start communication.
deviceName : Specifies the identifier used for identification of the target device.
Specifies the following for each device type:
Exceptions
When processing fails, EposException is thrown with one of the following error values.
• if communication with the printer is not required anymore, be sure to call closePrinter
(p.90), closePrinter API, to end communication with the printer.
• When you are opening the printer with another application via a Bluetooth connection, if
you try to begin communication with this API, the process may not return.
Set value Description
Print.DEVTYPE_TCP Wi-Fi/Ethernet device
Print.DEVTYPE_BLUETOOTH Bluetooth device
Set value Specified Value
Print.DEVTYPE_TCP IP address (IPv4)
Print.DEVTYPE_BLUETOOTH MAC address
Error status Description
ERR_PARAM Invalid parameter was passed.
ERR_OPEN Open processing failed.
ERR_ILLEGAL An attempt was made to start communicating with the device with
which communication had already started.
ERR_PROCESSING Could not execute process.
ERR_MEMORY Could not allocate memory.
ERR_FAILURE An unspecified error occurred.