Modifier and Type | Method and Description |
---|---|
boolean |
closeSerail()
关闭串口
|
boolean |
free()
释放模块,模块断电同时关闭串口
Release module |
static Module_qcom |
getInstance()
获取操作实例
Acquire operation Instance |
boolean |
init(int module)
初始化模块,模块上电同时打开串口
Initialize module |
boolean |
init(int module,
int baudrate)
初始化模块,模块上电同时打开串口
|
boolean |
init(int module,
int baudrate,
int databits,
int stopbits,
int check)
初始化模块 ,模块上电同时打开串口
Initialize the module |
void |
ioctl_gpio(int gpio,
boolean isHigh) |
boolean |
openSerail(java.lang.String path,
int baudrate,
int databits,
int stopbits,
int check)
打开串口
|
boolean |
powerOff(Context context,
int module)
模块下电,仅下电不关串口
module power off, power off only |
boolean |
powerOff(int module)
模块下电,仅下电不关串口
module power off, power off only |
boolean |
powerOn(Context context,
int module)
模块上电,仅上电不开串口,通过系统app上电,不经过DeviceAPI, 配合
powerOff(Context context,int module) 使用Module power on, power on only |
boolean |
powerOn(int module)
|
byte[] |
receive()
接收数据,读取串口数据会等待1秒钟
Receive data |
byte[] |
receiveEx()
接收数据,读取串口数据无等待时间
Receive data |
boolean |
send(byte[] data)
发送数据
Send data |
int |
sendAndReceive(byte[] sendData,
byte[] outData)
收发数据
|
public static Module_qcom getInstance()
public boolean powerOn(int module)
public boolean powerOn(Context context, int module)
powerOff(Context context,int module)
使用public void ioctl_gpio(int gpio, boolean isHigh)
ioctl_gpio
in interface IModule
public boolean powerOff(int module)
public boolean powerOff(Context context, int module)
public boolean init(int module)
public boolean init(int module, int baudrate)
public boolean init(int module, int baudrate, int databits, int stopbits, int check)
init
in interface IModule
module
- 模块编号 模块编号 1、1D(9600) 2、RFID(115200) 3、UHF(115200) 4、Finger(57600) 10、A8扩展串口baudrate
- 自定义波特率 check
- 是否校验 databits
- 数据位 取值为 7 或者8stopbits
- 停止位 取值为 1 或者2check
- 效验类型 取值为 0无, 1奇, 2偶public boolean free()
public boolean send(byte[] data)
public byte[] receive()
public byte[] receiveEx()
public int sendAndReceive(byte[] sendData, byte[] outData)
sendAndReceive
in interface IModule
sendData
- 发送的数据outData
- 接收的数据public boolean openSerail(java.lang.String path, int baudrate, int databits, int stopbits, int check)
openSerail
in interface IModule
baudrate
- 波特率databits
- 数据位 取值为 7 或者8stopbits
- 停止位 取值为 1 或者2check
- 效验类型 取值为 0无, 1奇, 2偶public boolean closeSerail()
closeSerail
in interface IModule