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)
IHarcHardwaresetDebug in interface IHarcHardwarepublic void open()
throws HarcHardwareException,
IOException
IHarcHardwareopen in interface IHarcHardwareHarcHardwareExceptionIOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void setTimeout(int timeout)
IHarcHardwaresetTimeout in interface IHarcHardwaretimeout - public void setBeginTimeout(int timeout)
setBeginTimeout in interface IIrReaderpublic void setCaptureMaxSize(int maxCaptureMaxSize)
setCaptureMaxSize in interface IIrReaderpublic void setEndingTimeout(int endingTimeout)
setEndingTimeout in interface IIrReaderpublic org.harctoolbox.ircore.ModulatedIrSequence capture()
throws IOException
capture in interface ICaptureIOExceptionpublic String getVersion()
getVersion in interface IHarcHardwarepublic void setVerbose(boolean verbose)
IHarcHardwaresetVerbose in interface IHarcHardwareverbose - on or offpublic boolean isValid()
IHarcHardwareisValid in interface IHarcHardwarepublic boolean stopCapture()
stopCapture in interface ICaptureCopyright © 2020. All rights reserved.