public class Command extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Command.CHARACTER_SET
国际字符集
|
static class |
Command.ENABLE |
static class |
Command.FONT
字体模式
|
static class |
Command.FOOT
钱箱引脚号
|
static class |
Command.HEIGHT_ZOOM
字符纵向放大
|
static class |
Command.HRI_POSITION
条码可识别字符位置
|
static class |
Command.ImageAlgorithm
位图处理算法
|
static class |
Command.JUSTIFICATION
对齐方式
|
static class |
Command.STATUS
打印机状态请求
|
static class |
Command.UNDERLINE_MODE
下划线模式
|
static class |
Command.WIDTH_ZOOM
字符横向放大
|
Modifier and Type | Field and Description |
---|---|
protected Connecter |
mConnecter |
Constructor and Description |
---|
Command() |
Modifier and Type | Method and Description |
---|---|
int |
close()
方法说明:关闭io
|
int |
connect(Connecter connecter)
连接外设
|
void |
connect(android.content.Context context,
Observer observer)
连接外设
|
Connecter |
getConnecter() |
boolean |
isConnected()
方法说明:是否已连接外设
|
void |
setConnecter(Connecter connecter)
设置连接器。传入的连接器连接不能为Null且连接状态必须为STATE_CONNECTER,否则将抛出异常
|
protected volatile Connecter mConnecter
public Connecter getConnecter()
public void setConnecter(Connecter connecter) throws NullPointerException, IllegalArgumentException
connecter
- 连接器NullPointerException,IllegalArgumentException
NullPointerException
IllegalArgumentException
public int connect(Connecter connecter) throws IOException
connecter
- 外设接口IOException
- IO异常Connecter.NOT_PERMISSION
,
Connecter.STATE_NONE
,
Connecter.STATE_CONNECTED
public void connect(android.content.Context context, Observer observer) throws IOException
context
- 上下文observer
- 连接状态回调IOException
public boolean isConnected()
public int close()