Package org.harctoolbox.harchardware.ir
Class IrGenericSerial
java.lang.Object
org.harctoolbox.harchardware.ir.IrSerial<LocalSerialPortBuffered>
org.harctoolbox.harchardware.ir.IrGenericSerial
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IHarcHardware
,IRawIrSender
This class models a serial device that takes text commands from a serial port, like the Arduino.
-
Field Summary
Fields inherited from class org.harctoolbox.harchardware.ir.IrSerial
serialPort, verbose
Fields inherited from interface org.harctoolbox.harchardware.ir.IRawIrSender
repeatMax
-
Constructor Summary
ConstructorDescriptionIrGenericSerial
(String portName, boolean verbose, Integer timeout, Integer baudRate, Integer dataSize, LocalSerialPort.StopBits stopBits, LocalSerialPort.Parity parity, LocalSerialPort.FlowControl flowControl) -
Method Summary
Modifier and TypeMethodDescriptionboolean
sendIr
(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) void
setCommand
(String command) void
setDebug
(int debug) Sets a debug parameter.void
setLineEnding
(String lineEnding) void
setRaw
(boolean raw) void
setSeparator
(String separator) void
setUseSigns
(boolean useSigns) Methods inherited from class org.harctoolbox.harchardware.ir.IrSerial
close, getTransmitter, getVersion, isValid, open, setBaudRate, setDataSize, setFlowControl, setParity, setPortName, setStopBits, setTimeout, setVerbose
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.harctoolbox.harchardware.ir.IRawIrSender
getTransmitter
-
Constructor Details
-
IrGenericSerial
public IrGenericSerial(String portName, boolean verbose, Integer timeout, Integer baudRate, Integer dataSize, LocalSerialPort.StopBits stopBits, LocalSerialPort.Parity parity, LocalSerialPort.FlowControl flowControl) throws IOException - Throws:
IOException
-
-
Method Details
-
setCommand
- Parameters:
command
- the command to set
-
setUseSigns
public void setUseSigns(boolean useSigns) - Parameters:
useSigns
- the useSigns to set
-
setSeparator
- Parameters:
separator
- the separator to set
-
setLineEnding
- Parameters:
lineEnding
- the lineEnding to set
-
setRaw
public void setRaw(boolean raw) - Parameters:
raw
- the raw to set
-
sendIr
public boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) throws NoSuchTransmitterException, IOException - Specified by:
sendIr
in interfaceIRawIrSender
- Returns:
- if false, command failed.
- Throws:
NoSuchTransmitterException
IOException
-
setDebug
public void setDebug(int debug) Description copied from interface:IHarcHardware
Sets a debug parameter. Exact semantic depends on the implementation.- Specified by:
setDebug
in interfaceIHarcHardware
-