public class DevLirc extends Object implements IRawIrSender, IReceive, ICapture, ITransmitter, IIrSenderStop
Modifier and Type | Field and Description |
---|---|
static String |
DEV |
static String |
DEVSLASHLIRC |
static String |
LIRCDEVPATTERN |
(package private) static Logger |
logger |
repeatMax
defaultBeginTimeout, defaultCaptureMaxSize, defaultEndingTimeout
Constructor and Description |
---|
DevLirc() |
DevLirc(String deviceName) |
DevLirc(String deviceName,
boolean verbose) |
Modifier and Type | Method and Description |
---|---|
boolean |
canReceive() |
boolean |
canSend() |
boolean |
canSetCarrier() |
boolean |
canSetTransmitter() |
org.harctoolbox.ircore.ModulatedIrSequence |
capture()
Listens to the device and returns a sequence.
|
void |
close() |
static File[] |
getCandidates() |
int |
getNumberTransmitters() |
Transmitter |
getTransmitter()
Returns a default Transmitter for the device.
|
LircTransmitter |
getTransmitter(int number) |
LircTransmitter |
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.
|
static void |
main(String[] args) |
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,
LircTransmitter transmitter) |
boolean |
sendIr(org.harctoolbox.ircore.IrSignal irSignal,
int count,
Transmitter transmitter) |
void |
setBeginTimeout(int timeout) |
void |
setCaptureMaxSize(int integer) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setEndingTimeout(int integer) |
void |
setTimeout(int timeout)
Deprecated.
|
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.
|
String |
toString() |
static final Logger logger
public static final String DEV
public static final String DEVSLASHLIRC
public static final String LIRCDEVPATTERN
public DevLirc(String deviceName, boolean verbose) throws org.harctoolbox.devslashlirc.LircDeviceException
org.harctoolbox.devslashlirc.LircDeviceException
public DevLirc(String deviceName) throws org.harctoolbox.devslashlirc.LircDeviceException
org.harctoolbox.devslashlirc.LircDeviceException
public DevLirc() throws org.harctoolbox.devslashlirc.LircDeviceException
org.harctoolbox.devslashlirc.LircDeviceException
public static File[] getCandidates()
public static void main(String[] args)
public boolean canSend()
public boolean canReceive()
public int getNumberTransmitters()
public boolean canSetCarrier()
public boolean canSetTransmitter()
public boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) throws HarcHardwareException
sendIr
in interface IRawIrSender
NoSuchTransmitterException
HarcHardwareException
public boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, LircTransmitter transmitter) throws HarcHardwareException
HarcHardwareException
public org.harctoolbox.ircore.IrSequence receive() throws HarcHardwareException, org.harctoolbox.ircore.OddSequenceLengthException
IReceive
receive
in interface IReceive
HarcHardwareException
- if the device is not in valid/open state.org.harctoolbox.ircore.OddSequenceLengthException
public boolean stopReceive()
IReceive
stopReceive
in interface IReceive
public boolean stopIr(Transmitter transmitter)
IIrSenderStop
stopIr
in interface IIrSenderStop
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 boolean isValid()
IHarcHardware
isValid
in interface IHarcHardware
@Deprecated public void setTimeout(int timeout) throws IOException
IHarcHardware
setTimeout
in interface IHarcHardware
timeout
- Timeout in milliseconds.IOException
public void setBeginTimeout(int timeout) 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 void open() throws HarcHardwareException
IHarcHardware
open
in interface IHarcHardware
HarcHardwareException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public Transmitter getTransmitter()
IRawIrSender
getTransmitter
in interface IRawIrSender
getTransmitter
in interface ITransmitter
public LircTransmitter getTransmitter(String connector) throws NoSuchTransmitterException
ITransmitter
getTransmitter
in interface ITransmitter
connector
- String describing desired port. Syntax is dependent on the implementing class.NoSuchTransmitterException
public LircTransmitter getTransmitter(int number) throws NoSuchTransmitterException
NoSuchTransmitterException
public String[] getTransmitterNames()
ITransmitter
getTransmitterNames
in interface ITransmitter
public org.harctoolbox.ircore.ModulatedIrSequence capture() throws HarcHardwareException, org.harctoolbox.ircore.OddSequenceLengthException
ICapture
capture
in interface ICapture
HarcHardwareException
- if the device is not in valid/open state.org.harctoolbox.ircore.OddSequenceLengthException
public boolean stopCapture()
ICapture
stopCapture
in interface ICapture
Copyright © 2019. All rights reserved.