public class IrWidget extends Object implements IHarcHardware, ICapture
http://www.compendiumarcana.com/irwidget/
Modifier and Type | Field and Description |
---|---|
static int |
defaultEndTimeout |
static String |
defaultPortName |
static int |
defaultRunTimeout |
static int |
defaultStartTimeout |
static int |
msPerTick
Number of micro seconds in a count msPerTick.
|
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 endTimeout,
boolean verbose)
Constructs new IrWidget.
|
Modifier and Type | Method and Description |
---|---|
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 |
setDebug(int debug)
Sets a debug parameter.
|
void |
setTimeout(int timeout)
Deprecated.
Use three argument version instead.
|
void |
setTimeout(int startTimeout,
int runTimeout,
int endTimeout) |
void |
setVerbosity(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 static final int defaultStartTimeout
public static final int defaultRunTimeout
public static final int defaultEndTimeout
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 endTimeout, boolean verbose)
portName
- Name of serial port to use. Typically something like COM7: (Windows) or /dev/ttyUSB0.verbose
- startTimeout
- runTimeout
- endTimeout
- public 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 startTimeout, int runTimeout, int endTimeout)
setTimeout
in interface ICapture
public void setTimeout(int timeout)
IHarcHardware
setTimeout
in interface IHarcHardware
timeout
- public ModulatedIrSequence capture() throws IOException
capture
in interface ICapture
IOException
public String getVersion()
getVersion
in interface IHarcHardware
public void setVerbosity(boolean verbose)
IHarcHardware
setVerbosity
in interface IHarcHardware
verbose
- on or offpublic boolean isValid()
IHarcHardware
isValid
in interface IHarcHardware
public boolean stopCapture()
stopCapture
in interface ICapture
public static void main(String[] args)
args
- the command line argumentsCopyright © 2015. All rights reserved.