public class Module
extends java.lang.Object
注意:
Attention:
1、使用前请确认您的机器已安装此模块。
1. Make sure this module is installed before you use your device.
2、要正常使用模块需要在\libs\armeabi\目录放置libDeviceAPI.so文件。
2. Put libDeviceAPI.so file in directory \libs\armeabi\ then module can used normally.
3、在操作设备前需要调用 init(int) 打开设备,使用完后调用 free() 关闭设备
3. call init(int) to switch on device before operating the device, call free() to switch off the device after using.
| Modifier and Type | Method and Description |
|---|---|
boolean |
free()
释放模块
Release module |
static Module |
getInstance()
获取操作实例
Acquire operation Instance |
boolean |
init(int module)
初始化模块
Initialize module |
boolean |
init(int module,
int baudrate)
初始化模块
|
void |
ioctl_gpio(int gpio,
boolean isHigh) |
boolean |
powerOff(int module)
模块下电,仅下电不关串口
module power off, power off only |
boolean |
powerOn(int module)
模块上电,仅上电不开串口
Module power on, power on only |
byte[] |
receive()
接收数据
Receive data |
boolean |
send(byte[] data)
发送数据
Send data |
boolean |
uartSwitch2(int module)
Deprecated.
|
public static Module getInstance() throws ConfigurationException
ConfigurationExceptionpublic boolean powerOn(int module)
module - 模块编号 1、1D(9600) 2、RFID(115200) 3、UHF(115200) 4、Finger(57600)module - module serial number 1, 1D(9600) 2, RFID(115200) 3, UHF(115200) 4, Finger(57600)public void ioctl_gpio(int gpio,
boolean isHigh)
public boolean powerOff(int module)
module - 模块编号 1、1D(9600) 2、RFID(115200) 3、UHF(115200) 4、Finger(57600)module - module serial number 1, 1D(9600) 2, RFID(115200) 3, UHF(115200) 4, Finger(57600)@Deprecated public boolean uartSwitch2(int module)
public boolean init(int module)
module - 模块编号 模块编号 1、1D(9600) 2、RFID(115200) 3、UHF(115200) 4、Finger(57600)5、OBDmodule - module serial number 1, 1D(9600) 2, RFID(115200) 3, UHF(115200) 4, Finger(57600) 5,OBDpublic boolean init(int module,
int baudrate)
module - 模块编号 模块编号 1、1D(9600) 2、RFID(115200) 3、UHF(115200) 4、Finger(57600)baudrate - 自定义波特率public boolean free()
public boolean send(byte[] data)
data - 数据public byte[] receive()