Package org.harctoolbox.harchardware.ir
Class IRrecvDumpV2
java.lang.Object
org.harctoolbox.harchardware.ir.IRrecvDumpV2
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IHarcHardware
,IIrReader
,IReceive
-
Field Summary
Fields inherited from interface org.harctoolbox.harchardware.ir.IIrReader
DEFAULT_BEGIN_TIMEOUT, DEFAULT_CAPTURE_MAXSIZE, DEFAULT_ENDING_TIMEOUT
-
Constructor Summary
ConstructorDescriptionIRrecvDumpV2
(String portName, boolean verbose, Integer timeout) IRrecvDumpV2
(String portName, boolean verbose, Integer timeout, Integer baud) IRrecvDumpV2
(LocalSerialPortBuffered hardware) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Returns the hardware version (not the version of the driver software).boolean
isValid()
Checks validity of an instance.void
open()
Opens the device with previously set parameters.org.harctoolbox.ircore.IrSequence
receive()
Listens to the device and returns a sequence.void
reset()
void
setBeginTimeout
(int beginTimeout) void
setCaptureMaxSize
(int integer) void
setDebug
(int debug) Sets a debug parameter.void
setEndingTimeout
(int endingTimeout) void
setTimeout
(int timeout) Set timeout in milliseconds.void
setVerbose
(boolean verbose) Sets a verbosity flag, causing commands to be executed verbosely.boolean
Signals the receiving device that it should stop receiving.
-
Constructor Details
-
IRrecvDumpV2
- Throws:
HarcHardwareException
IOException
-
IRrecvDumpV2
public IRrecvDumpV2(String portName, boolean verbose, Integer timeout, Integer baud) throws IOException, HarcHardwareException - Throws:
IOException
HarcHardwareException
-
IRrecvDumpV2
public IRrecvDumpV2(String portName, boolean verbose, Integer timeout) throws IOException, HarcHardwareException - Throws:
IOException
HarcHardwareException
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
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
- Returns:
- Version string. Semantics can vary.
- Throws:
IOException
-
setVerbose
public void setVerbose(boolean verbose) Description copied from interface:IHarcHardware
Sets a verbosity flag, causing commands to be executed verbosely. Exact semantic depends on the implementation. Typically, all communication with the device is echoed to stderr.- Specified by:
setVerbose
in interfaceIHarcHardware
- Parameters:
verbose
- on or off
-
setBeginTimeout
- Specified by:
setBeginTimeout
in interfaceIIrReader
- Throws:
IOException
-
isValid
public boolean isValid()Description copied from interface:IHarcHardware
Checks validity of an instance. Exact meaning can vary.- Specified by:
isValid
in interfaceIHarcHardware
- Returns:
- validity of the instance.
-
open
Description copied from interface:IHarcHardware
Opens the device with previously set parameters.- Specified by:
open
in interfaceIHarcHardware
- Throws:
IOException
HarcHardwareException
-
receive
public org.harctoolbox.ircore.IrSequence receive() throws HarcHardwareException, IOException, org.harctoolbox.ircore.OddSequenceLengthExceptionDescription copied from interface:IReceive
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:
receive
in interfaceIReceive
- Returns:
- Captured sequence, or null by timeout.
- Throws:
HarcHardwareException
- if the device is not in valid/open state.IOException
org.harctoolbox.ircore.OddSequenceLengthException
-
stopReceive
public boolean stopReceive()Description copied from interface:IReceive
Signals the receiving device that it should stop receiving. May not be implemented in all hardware.- Specified by:
stopReceive
in interfaceIReceive
- Returns:
- status
-
reset
- Throws:
IOException
HarcHardwareException
-
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
-
setTimeout
Description copied from interface:IHarcHardware
Set timeout in milliseconds. Exact semantics may be dependent on the hardware.- Specified by:
setTimeout
in interfaceIHarcHardware
- Parameters:
timeout
- Timeout in milliseconds.- Throws:
IOException
-
setCaptureMaxSize
public void setCaptureMaxSize(int integer) - Specified by:
setCaptureMaxSize
in interfaceIIrReader
-
setEndingTimeout
public void setEndingTimeout(int endingTimeout) - Specified by:
setEndingTimeout
in interfaceIIrReader
-