public class IrDummy extends Object implements IHarcHardware, IRawIrSender, IIrSenderStop, ITransmitter, ICapture, IReceive, IRemoteCommandIrSender
Modifier and Type | Field and Description |
---|---|
static String |
defaultVersion |
repeatMax
defaultBeginTimeout, defaultCaptureMaxSize, defaultEndingTimeout
repeatMax
Modifier and Type | Method and Description |
---|---|
org.harctoolbox.ircore.ModulatedIrSequence |
capture()
Listens to the device and returns a sequence.
|
void |
close() |
String[] |
getCommands(String remote)
Returns an array of command names for the remote given in the argument.
|
String[] |
getRemotes()
Returns an array of "remote" names.
|
Transmitter |
getTransmitter()
Returns a default Transmitter for the device.
|
Transmitter |
getTransmitter(String connector)
Parses the String argument, and returns a transmitter accordingly.
|
String[] |
getTransmitterNames()
Return possible name of transmitters, that are guaranteed to work with the getTransmitter(String).
|
String |
getVersion()
Returns the hardware version (not the version of the driver software).
|
boolean |
isValid()
Tries to identify instances that are not valid.
|
void |
open()
Opens the device with previously set parameters.
|
org.harctoolbox.ircore.IrSequence |
receive()
Listens to the device and returns a sequence.
|
boolean |
sendIr(org.harctoolbox.ircore.IrSignal irSignal,
int count,
Transmitter transmitter) |
boolean |
sendIrCommand(String remote,
String command,
int count,
Transmitter transmitter)
Sends the command to the hardware, to be sent count number of times.
|
boolean |
sendIrCommandRepeat(String remote,
String command,
Transmitter transmitter)
Like sendIr, but sends the IR signal until stopped by stopIr.
|
void |
setBeginTimeout(int integer) |
void |
setCaptureMaxSize(int integer) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setEndingTimeout(int integer) |
void |
setTimeout(int timeout)
Set timeout in milliseconds.
|
void |
setVerbose(boolean verbose)
Sets a verbosity flag, causing commands to be executed verbosely.
|
boolean |
stopCapture()
Signals the capturing device that it should stop capturing.
|
boolean |
stopIr(Transmitter transmitter)
Stops ongoing IR transmission.
|
boolean |
stopReceive()
Signals the receiving device that it should stop receiving.
|
public static final String defaultVersion
public IrDummy(String version)
public IrDummy()
public String getVersion() throws IOException
IHarcHardware
getVersion
in interface IHarcHardware
IOException
public void setVerbose(boolean verbose)
IHarcHardware
setVerbose
in interface IHarcHardware
verbose
- on or offpublic void setDebug(int debug)
IHarcHardware
setDebug
in interface IHarcHardware
public void setTimeout(int timeout) throws IOException
IHarcHardware
setTimeout
in interface IHarcHardware
timeout
- Timeout in milliseconds.IOException
public boolean isValid()
IHarcHardware
isValid
in interface IHarcHardware
public void open() throws HarcHardwareException, IOException
IHarcHardware
open
in interface IHarcHardware
HarcHardwareException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) throws HarcHardwareException, NoSuchTransmitterException, IOException
sendIr
in interface IRawIrSender
NoSuchTransmitterException
IOException
HarcHardwareException
public Transmitter getTransmitter()
IRawIrSender
getTransmitter
in interface IRawIrSender
getTransmitter
in interface IRemoteCommandIrSender
getTransmitter
in interface ITransmitter
public boolean stopIr(Transmitter transmitter) throws NoSuchTransmitterException, IOException
IIrSenderStop
stopIr
in interface IIrSenderStop
NoSuchTransmitterException
IOException
public Transmitter getTransmitter(String connector) throws NoSuchTransmitterException
ITransmitter
getTransmitter
in interface ITransmitter
connector
- String describing desired port. Syntax is dependent on the implementing class.NoSuchTransmitterException
public String[] getTransmitterNames()
ITransmitter
getTransmitterNames
in interface ITransmitter
public org.harctoolbox.ircore.ModulatedIrSequence capture() throws HarcHardwareException, IOException
ICapture
capture
in interface ICapture
HarcHardwareException
- if the device is not in valid/open state.IOException
public boolean stopCapture()
ICapture
stopCapture
in interface ICapture
public void setBeginTimeout(int integer) throws IOException
setBeginTimeout
in interface IIrReader
IOException
public void setCaptureMaxSize(int integer)
setCaptureMaxSize
in interface IIrReader
public void setEndingTimeout(int integer)
setEndingTimeout
in interface IIrReader
public String[] getRemotes() throws IOException
IRemoteCommandIrSender
getRemotes
in interface IRemoteCommandIrSender
IOException
public String[] getCommands(String remote) throws IOException
IRemoteCommandIrSender
getCommands
in interface IRemoteCommandIrSender
remote
- The "remote" to search inIOException
public boolean sendIrCommand(String remote, String command, int count, Transmitter transmitter) throws IOException, NoSuchTransmitterException
IRemoteCommandIrSender
sendIrCommand
in interface IRemoteCommandIrSender
count
- Number of times to repeat the commandIOException
NoSuchTransmitterException
public boolean sendIrCommandRepeat(String remote, String command, Transmitter transmitter) throws IOException, NoSuchTransmitterException
IRemoteCommandIrSender
sendIrCommandRepeat
in interface IRemoteCommandIrSender
IOException
NoSuchTransmitterException
public org.harctoolbox.ircore.IrSequence receive() throws HarcHardwareException, IOException
IReceive
receive
in interface IReceive
HarcHardwareException
- if the device is not in valid/open state.IOException
public boolean stopReceive()
IReceive
stopReceive
in interface IReceive
Copyright © 2019. All rights reserved.