Package org.harctoolbox.harchardware.ir
Class CommandFusion
java.lang.Object
org.harctoolbox.harchardware.ir.IrSerial<LocalSerialPortRaw>
org.harctoolbox.harchardware.ir.CommandFusion
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IHarcHardware
,ICapture
,IIrReader
,IRawIrSender
This class implements capturing and sending support for the CommandFusion Learner.
see IR learner,
IR Module, and
USB Communication Protocol.
This device does not support settable timeouts, due to limitations in the hardware.
beginTimeout is effectively 20 seconds,
captureLength 2 seconds,
endingTimeout: not applicable.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
static final int
static final String
Fields inherited from class org.harctoolbox.harchardware.ir.IrSerial
serialPort, verbose
Fields inherited from interface org.harctoolbox.harchardware.ir.IIrReader
DEFAULT_BEGIN_TIMEOUT, DEFAULT_CAPTURE_MAXSIZE, DEFAULT_ENDING_TIMEOUT
Fields inherited from interface org.harctoolbox.harchardware.ir.IRawIrSender
repeatMax
-
Constructor Summary
ConstructorDescriptionCommandFusion
(String portName) CommandFusion
(String portName, boolean verbose) CommandFusion
(String portName, boolean verbose, Integer timeout) CommandFusion
(String portName, boolean verbose, Integer timeoutNotUsed, Integer baudRate) -
Method Summary
Modifier and TypeMethodDescriptionorg.harctoolbox.ircore.ModulatedIrSequence
capture()
Listens to the device and returns a sequence.Returns the hardware version (not the version of the driver software).void
open()
Opens the device with previously set parameters.boolean
sendIr
(int deviceType, int codeset, int key) Sends an IR signal from the built-in, proprietary data base.boolean
sendIr
(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) void
setBeginTimeout
(int integer) Dummy without function.void
setCaptureMaxSize
(int integer) Dummy without function.void
setDebug
(int debug) Dummy without function.void
setEndingTimeout
(int integer) Dummy without function.boolean
Signals the capturing device that it should stop capturing.Methods inherited from class org.harctoolbox.harchardware.ir.IrSerial
close, getTransmitter, isValid, 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.IHarcHardware
isValid, setTimeout, setVerbose
Methods inherited from interface org.harctoolbox.harchardware.ir.IRawIrSender
getTransmitter
-
Field Details
-
DEFAULTPORTNAME
- See Also:
-
DEFAULTBAUDRATE
public static final int DEFAULTBAUDRATE- See Also:
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT- See Also:
-
COMMAND_FUSION
- See Also:
-
-
Constructor Details
-
CommandFusion
- Throws:
IOException
-
CommandFusion
- Throws:
IOException
-
CommandFusion
- Throws:
IOException
-
CommandFusion
- Throws:
IOException
-
CommandFusion
public CommandFusion(String portName, boolean verbose, Integer timeoutNotUsed, Integer baudRate) throws IOException - Throws:
IOException
-
-
Method Details
-
setDebug
public void setDebug(int debug) Dummy without function.- Specified by:
setDebug
in interfaceIHarcHardware
- Parameters:
debug
-
-
open
Description copied from interface:IHarcHardware
Opens the device with previously set parameters.- Specified by:
open
in interfaceIHarcHardware
- Overrides:
open
in classIrSerial<LocalSerialPortRaw>
- Throws:
HarcHardwareException
IOException
-
sendIr
Sends an IR signal from the built-in, proprietary data base. Not tested.- Parameters:
deviceType
-codeset
-key
- function code- Returns:
- success of operation
- Throws:
IOException
-
sendIr
public boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) throws IOException - Specified by:
sendIr
in interfaceIRawIrSender
- Parameters:
irSignal
-count
-transmitter
- Not used- Returns:
- Success of operation.
- Throws:
IOException
-
capture
public org.harctoolbox.ircore.ModulatedIrSequence capture() throws IOException, org.harctoolbox.ircore.InvalidArgumentExceptionDescription copied from interface:ICapture
Listens to the device and returns a sequence. Requires the device to be previously opened. Should itself neither open or close the device.- Specified by:
capture
in interfaceICapture
- Returns:
- Captured sequence, or null by timeout.
- Throws:
IOException
org.harctoolbox.ircore.OddSequenceLengthException
org.harctoolbox.ircore.InvalidArgumentException
-
stopCapture
public boolean stopCapture()Description copied from interface:ICapture
Signals the capturing device that it should stop capturing. May not be implemented in all hardware.- Specified by:
stopCapture
in interfaceICapture
- Returns:
- status
-
getVersion
Description copied from interface:IHarcHardware
Returns the hardware version (not the version of the driver software). May be null if no relevant information available.- Specified by:
getVersion
in interfaceIHarcHardware
- Overrides:
getVersion
in classIrSerial<LocalSerialPortRaw>
- Returns:
- Version string. Semantics can vary.
-
setBeginTimeout
public void setBeginTimeout(int integer) Dummy without function.- Specified by:
setBeginTimeout
in interfaceIIrReader
- Parameters:
integer
-
-
setCaptureMaxSize
public void setCaptureMaxSize(int integer) Dummy without function.- Specified by:
setCaptureMaxSize
in interfaceIIrReader
- Parameters:
integer
-
-
setEndingTimeout
public void setEndingTimeout(int integer) Dummy without function.- Specified by:
setEndingTimeout
in interfaceIIrReader
- Parameters:
integer
-
-