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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final intstatic final StringFields inherited from class org.harctoolbox.harchardware.ir.IrSerial
serialPort, verboseFields inherited from interface org.harctoolbox.harchardware.ir.IIrReader
DEFAULT_BEGIN_TIMEOUT, DEFAULT_CAPTURE_MAXSIZE, DEFAULT_ENDING_TIMEOUTFields inherited from interface org.harctoolbox.harchardware.ir.IRawIrSender
repeatMax -
Constructor Summary
ConstructorsConstructorDescriptionCommandFusion(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.ModulatedIrSequencecapture()Listens to the device and returns a sequence.Returns the hardware version (not the version of the driver software).voidopen()Opens the device with previously set parameters.booleansendIr(int deviceType, int codeset, int key) Sends an IR signal from the built-in, proprietary data base.booleansendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) voidsetBeginTimeout(int integer) Dummy without function.voidsetCaptureMaxSize(int integer) Dummy without function.voidsetDebug(int debug) Dummy without function.voidsetEndingTimeout(int integer) Dummy without function.booleanSignals 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, setVerboseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.harctoolbox.harchardware.IHarcHardware
isValid, setTimeout, setVerboseMethods 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:
setDebugin interfaceIHarcHardware- Parameters:
debug-
-
open
Description copied from interface:IHarcHardwareOpens the device with previously set parameters.- Specified by:
openin interfaceIHarcHardware- Overrides:
openin classIrSerial<LocalSerialPortRaw>- Throws:
HarcHardwareExceptionIOException
-
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:
sendIrin 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:ICaptureListens to the device and returns a sequence. Requires the device to be previously opened. Should itself neither open or close the device.- Specified by:
capturein interfaceICapture- Returns:
- Captured sequence, or null by timeout.
- Throws:
IOExceptionorg.harctoolbox.ircore.OddSequenceLengthExceptionorg.harctoolbox.ircore.InvalidArgumentException
-
stopCapture
public boolean stopCapture()Description copied from interface:ICaptureSignals the capturing device that it should stop capturing. May not be implemented in all hardware.- Specified by:
stopCapturein interfaceICapture- Returns:
- status
-
getVersion
Description copied from interface:IHarcHardwareReturns the hardware version (not the version of the driver software). May be null if no relevant information available.- Specified by:
getVersionin interfaceIHarcHardware- Overrides:
getVersionin classIrSerial<LocalSerialPortRaw>- Returns:
- Version string. Semantics can vary.
-
setBeginTimeout
public void setBeginTimeout(int integer) Dummy without function.- Specified by:
setBeginTimeoutin interfaceIIrReader- Parameters:
integer-
-
setCaptureMaxSize
public void setCaptureMaxSize(int integer) Dummy without function.- Specified by:
setCaptureMaxSizein interfaceIIrReader- Parameters:
integer-
-
setEndingTimeout
public void setEndingTimeout(int integer) Dummy without function.- Specified by:
setEndingTimeoutin interfaceIIrReader- Parameters:
integer-
-