COMPAX POS Printer
This is a programming manual for the embedded printer within COMPAX POS terminal.
Introduction
Details
Calling Interface Sample
PrinterProxy requires connection timeout
Socket s = new Socket();
// IP: String type, value: 127.0.0.1 or the real local IP address
// portNum: int type, value: 9100 or 9101 (GB2312 or UTF8 encoding)
// 1000: value 1000 means connection timeout -> 1000ms
s.connect(new InetSocketAddress(IP, portNum), 1000);
OutputStream out = s.getOutputStream();
InputStream in = s.getInputStream();
Log.d(TAG, tid + " Sending data to printer server " + IP + ":" + portNum);
out.write(new byte[]{0x10, 0x04, 0x02});
out.write(printerBytes); // printerBytes is the printing data in bytes[] arrayPrinterProxy DOES NOT require connection timeout
Note (Important):
Last updated