EasyManua.ls Logo

Epson TM T88V - Opening a Device Port; Sending Data

Epson TM T88V
122 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
102
Opening a Device Port
Use the EpsonIo class's open (p.105) to open a device port. Please refer to the following code.
Sending Data
Use the EpsonIo class's write (p.108) to send data to the printer. Please refer to the following code.
//Initialize the EpsonIo class
EpsonIo mPort = new EpsonIo();
int errStatus = IoStatus.SUCCESS;
//Open the device port
try {
mPort.open(DevType.TCP, "192.168.192.168", null);
//Exception handling
} catch ( EpsonIoException e ) {
errStatus = e.getStatus();
}
//Settings for sending
String str = "Hello, World!\r\n";
byte[] data = str.getBytes();
int offset = 0;
int size = data.length;
int timeout = 5000;
int sizeWritten = 0;
int errStatus = IoStatus.SUCCESS;
try {
//Send data
sizeWritten = mPort.write(data, offset, size, timeout);
//Exception handling
} catch ( EpsonIoException e ) {
errStatus = e.getStatus();
}
Printing out "Hello, World!"

Table of Contents

Other manuals for Epson TM T88V

Related product manuals