public class IrWidget extends Object implements IHarcHardware, ICapture
Modifier and Type | Field and Description |
---|---|
static String |
defaultPortName |
static int |
msPerTick
Number of micro seconds in a count msPerTick.
|
defaultBeginTimeout, defaultCaptureMaxSize, defaultEndingTimeout
Constructor and Description |
---|
IrWidget()
Constructs new IrWidget with default port name and timeouts.
|
IrWidget(String portName,
boolean verbose,
int debug)
Constructs new IrWidget with default timeouts.
|
IrWidget(String portName,
int startTimeout,
int runTimeout,
int endingTimeout,
boolean verbose)
Constructs new IrWidget.
|
Modifier and Type | Method and Description |
---|---|
org.harctoolbox.ircore.ModulatedIrSequence |
capture()
Captures a signal using the given timeout values, and returns it as a ModulatedIrSequence.
|
void |
close() |
String |
getVersion()
The IrWidget does not support versions.
|
boolean |
isValid()
Tries to identify instances that are not valid.
|
static void |
main(String[] args)
For testing purposes only.
|
void |
open()
Opens the device with previously set parameters.
|
void |
setBeginTimeout(int timeout) |
void |
setCaptureMaxSize(int maxCaptureMaxSize) |
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 |
stopCapture()
Stops ongoing capture.
|
public static final int msPerTick
public static final String defaultPortName
public IrWidget()
public IrWidget(String portName, boolean verbose, int debug)
portName
- Name of serial port to use. Typically something like COM7: (Windows) or /dev/ttyUSB0.verbose
- debug
- debug codepublic IrWidget(String portName, int startTimeout, int runTimeout, int endingTimeout, boolean verbose)
portName
- Name of serial port to use. Typically something like COM7: (Windows) or /dev/ttyUSB0.verbose
- startTimeout
- runTimeout
- endingTimeout
- public static void main(String[] args)
args
- the command line argumentspublic void setDebug(int debug)
IHarcHardware
setDebug
in interface IHarcHardware
public void open() throws HarcHardwareException, IOException
IHarcHardware
open
in interface IHarcHardware
HarcHardwareException
IOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void setTimeout(int timeout)
IHarcHardware
setTimeout
in interface IHarcHardware
timeout
- public void setBeginTimeout(int timeout)
setBeginTimeout
in interface IIrReader
public void setCaptureMaxSize(int maxCaptureMaxSize)
setCaptureMaxSize
in interface IIrReader
public void setEndingTimeout(int endingTimeout)
setEndingTimeout
in interface IIrReader
public org.harctoolbox.ircore.ModulatedIrSequence capture() throws IOException
capture
in interface ICapture
IOException
public String getVersion()
getVersion
in interface IHarcHardware
public void setVerbose(boolean verbose)
IHarcHardware
setVerbose
in interface IHarcHardware
verbose
- on or offpublic boolean isValid()
IHarcHardware
isValid
in interface IHarcHardware
public boolean stopCapture()
stopCapture
in interface ICapture
Copyright © 2019. All rights reserved.