Modifier and Type | Method and Description |
---|---|
boolean |
close()
关闭红外模块
Switch off infared module |
void |
closeLED()
关闭辅助灯
Close LED |
java.lang.String |
getIDAndPowerWithWattmeter()
获取电表ID和电能值,97标准
Acquire powermeter ID and energy value, 97 standard |
java.lang.String |
getIDAndPowerWithWattmeter(int protocol)
获取电表ID和电能值
Acquire powermeter ID and energy value |
static Infrared |
getInstance() |
boolean |
isPowerOn() |
boolean |
open()
打开红外模块,默认1200波特率
Switch on infared module, default 1200 baud rate |
boolean |
open(int baudrate)
打开红外模块
Switch on infared module |
boolean |
open(int baudrate,
int check)
打开红外模块
Switch on infared module |
boolean |
open(int baudrate,
int dataBits,
int stopBits,
int check)
打开红外模块
Switch on infared module |
void |
openLED()
打开辅助灯
Open LED |
byte[] |
receive()
接收数据
Receive data |
boolean |
send(byte[] data)
发送数据
send Data |
boolean |
switchBaudrate(int baudrate,
int dataBits,
int stopBits,
int check)
切换波特率
|
public static Infrared getInstance() throws ConfigurationException
ConfigurationException
- 配置错误异常public boolean open()
public boolean open(int baudrate)
public boolean open(int baudrate, int check)
public boolean open(int baudrate, int dataBits, int stopBits, int check)
public boolean switchBaudrate(int baudrate, int dataBits, int stopBits, int check)
switchBaudrate
in interface IInfrared
baudrate
- 波特率dataBits
- 数据位stopBits
- 停止位check
- 校验位public boolean close()
public boolean send(byte[] data)
public byte[] receive()
public java.lang.String getIDAndPowerWithWattmeter()
getIDAndPowerWithWattmeter
in interface IInfrared
public java.lang.String getIDAndPowerWithWattmeter(int protocol)
getIDAndPowerWithWattmeter
in interface IInfrared
protocol
- 97,DL/T 645—1997标准;07,DL/T 645—2007标准protocol
- 97, DL/T 645-1997 standard;07,DL/T 645-2007 standard