public class ExternalPrinterInterface
extends java.lang.Object
Constructor and Description |
---|
ExternalPrinterInterface() |
Modifier and Type | Method and Description |
---|---|
static int |
begin(int handle)
prepare to print
|
static int |
close(int handle)
close the device
|
static int |
end(int handle)
end to print
|
static int |
open(java.lang.String entity)
open the device
|
static int |
queryStatus(int handle)
query the status of printer
|
static int |
queryVoltage(int handle,
int[] pCapacity,
int[] pVoltage)
query the capacity and voltage
|
static int |
read(int handle,
byte[] arryData,
int nDataLength,
int nTimeout)
read the data from the device
|
static int |
write(int handle,
byte[] arryData,
int nDataLength)
write the data to the device
|
public static int open(java.lang.String entity)
entity
- public static int close(int handle)
handle
- : returned from method of open.public static int begin(int handle)
handle
- : returned from method of open.public static int end(int handle)
handle
- : returned from method of open.public static int write(int handle, byte[] arryData, int nDataLength)
handle
- : returned from method of open.arryData
- : data or control commandnDataLength
- : length of data or control commandpublic static int read(int handle, byte[] arryData, int nDataLength, int nTimeout)
handle
- : returned from method of open.arryData
- : byte to save resultnDataLength
- : expect length of datanTimeout
- : time outpublic static int queryStatus(int handle)
handle
- : returned from method of open.
return value : < 0 : error code
= 0 : no paper
= 1 : has paper
other value : RFUpublic static int queryVoltage(int handle, int[] pCapacity, int[] pVoltage)
handle
- : returned from method of open.
return value : < 0 : error code
>= 0 : success