Receiving Data
Use the EpsonIo class's
read (p.110)
//Settings for receiving
byte[] data = new byte[256];
int offset = 0;
int size = 256;
int timeout = 5000;
int sizeRead = 0;
int errStatus = IoStatus.SUCCESS;
//Receive data
try {
sizeRead = mPort.read(data, offset, size, timeout);
//Exception handling
} catch ( EpsonIoException e ) {
errStatus = e.getStatus();
}
Closing the Device Port
Use the EpsonIo class's
close (p.107)
int errStatus = IoStatus.SUCCESS;
//Close the device port
try {
mPort.close();
//Exception handling
} catch ( EpsonIoException e ) {
errStatus = e.getStatus();
}
Chapter 5 Command Transmission/Reception
to receive data from the printer. Please refer to the following code.
to close the device port. Please refer to the following code.
5
103