public class SerialPortInterface extends PrinterInterface
Constructor and Description |
---|
SerialPortInterface() |
Modifier and Type | Method and Description |
---|---|
void |
connect(java.lang.Object object)
Connect printer device
连接打印机 |
void |
disConnect()
Interrupt connection
断开连接 |
ConnectStateEnum |
getConnectState()
Get connect state
获取连接状态 |
byte[] |
readMsg()
Read the messages from the printer
读取打印机的回传信息 |
void |
writeMsg(byte[] btCmds)
Send byte array to the printer(Run in Main Thread)
发送指令到打印机(主线程中运行) |
void |
writeMsgAsync(byte[] btCmds)
Send byte array to the printer(Run in Sub-Thread)
发送指令到打印机(子线程中运行) |
getConfigObject, getmName, setConfigObject, setmName
public void connect(java.lang.Object object) throws java.lang.Exception
PrinterInterface
connect
in class PrinterInterface
object
- BluetoothEdrConfigBean, WiFiConfigBean, UsbConfigBeanjava.lang.Exception
public void disConnect()
PrinterInterface
disConnect
in class PrinterInterface
public ConnectStateEnum getConnectState()
PrinterInterface
getConnectState
in class PrinterInterface
public void writeMsg(byte[] btCmds)
PrinterInterface
writeMsg
in class PrinterInterface
btCmds
- commnads , 指令public void writeMsgAsync(byte[] btCmds)
PrinterInterface
writeMsgAsync
in class PrinterInterface
btCmds
- commnads , 指令public byte[] readMsg()
PrinterInterface
readMsg
in class PrinterInterface