public class PrinterInterface
extends java.lang.Object
Constructor and Description |
---|
PrinterInterface() |
Modifier and Type | Method and Description |
---|---|
static int |
begin()
prepare to print.
|
static int |
close()
close the device.
|
static int |
end()
end to print.
|
static boolean |
isOpened() |
static int |
open()
open the device.
|
static int |
queryStatus()
query the status of printer.
|
static int |
queryVoltage(int[] pCapacity,
int[] pVoltage)
query the capacity and voltage.
|
static int |
read(byte[] arryData,
int nDataLength,
int nTimeout)
read the data from the device.
|
static int |
write(byte[] arryData,
int nDataLength)
write the data to the device.
|
static int |
write(byte[] arryData,
int offset,
int nDataLength)
write the data to the device.
|
public static int open()
public static int close()
public static int begin()
public static int end()
public static int write(byte[] arryData, int nDataLength)
arryData
- : data or control commandnDataLength
- : length of data or control commandpublic static int read(byte[] arryData, int nDataLength, int nTimeout)
arryData
- : byte to save resultnDataLength
- : expect length of datanTimeout
- : time outpublic static int write(byte[] arryData, int offset, int nDataLength)
arryData
- : data or control commandoffset
- : offset for data.nDataLength
- : length of data or control commandpublic static int queryStatus()
public static int queryVoltage(int[] pCapacity, int[] pVoltage)
public static boolean isOpened()