Package org.harctoolbox.harchardware.ir
Class DevLirc
java.lang.Object
org.harctoolbox.harchardware.ir.DevLirc
- All Implemented Interfaces:
Closeable,AutoCloseable,IHarcHardware,ICapture,IIrReader,IIrSenderStop,IRawIrSender,IReceive,ITransmitter
public class DevLirc
extends Object
implements IRawIrSender, IReceive, ICapture, ITransmitter, IIrSenderStop
-
Field Summary
FieldsFields inherited from interface org.harctoolbox.harchardware.ir.IIrReader
DEFAULT_BEGIN_TIMEOUT, DEFAULT_CAPTURE_MAXSIZE, DEFAULT_ENDING_TIMEOUTFields inherited from interface org.harctoolbox.harchardware.ir.IRawIrSender
repeatMax -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanSend()booleanbooleanorg.harctoolbox.ircore.ModulatedIrSequencecapture()Listens to the device and returns a sequence.voidclose()static File[]intReturns a default Transmitter for the device.getTransmitter(int number) getTransmitter(String connector) Parses the String argument, and returns a transmitter accordingly.String[]Return possible name of transmitters, that are guaranteed to work with the getTransmitter(String).Returns the hardware version (not the version of the driver software).booleanisValid()Checks validity of an instance.static voidvoidopen()Opens the device with previously set parameters.org.harctoolbox.ircore.IrSequencereceive()Listens to the device and returns a sequence.booleansendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, LircTransmitter transmitter) booleansendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) voidsetBeginTimeout(int timeout) voidsetCaptureMaxSize(int integer) voidsetDebug(int debug) Sets a debug parameter.voidsetEndingTimeout(int integer) voidsetTimeout(int timeout) Deprecated.voidsetVerbose(boolean verbose) Sets a verbosity flag, causing commands to be executed verbosely.booleanSignals the capturing device that it should stop capturing.booleanstopIr(Transmitter transmitter) Stops ongoing IR transmission.booleanSignals the receiving device that it should stop receiving.toString()
-
Field Details
-
DEV
- See Also:
-
DEVSLASHLIRC
- See Also:
-
LIRCDEVPATTERN
- See Also:
-
-
Constructor Details
-
DevLirc
public DevLirc(String deviceName, boolean verbose) throws org.harctoolbox.devslashlirc.LircDeviceException - Throws:
org.harctoolbox.devslashlirc.LircDeviceException
-
DevLirc
public DevLirc(String deviceName, boolean verbose, Integer timeout) throws org.harctoolbox.devslashlirc.LircDeviceException - Throws:
org.harctoolbox.devslashlirc.LircDeviceException
-
DevLirc
- Throws:
org.harctoolbox.devslashlirc.LircDeviceException
-
DevLirc
public DevLirc() throws org.harctoolbox.devslashlirc.LircDeviceException- Throws:
org.harctoolbox.devslashlirc.LircDeviceException
-
-
Method Details
-
getCandidates
-
main
-
canSend
public boolean canSend()- Returns:
- the canSend
-
canReceive
public boolean canReceive()- Returns:
- the canReceive
-
getNumberTransmitters
public int getNumberTransmitters()- Returns:
- the numberTransmitters
-
canSetCarrier
public boolean canSetCarrier()- Returns:
- the canSetCarrier
-
canSetTransmitter
public boolean canSetTransmitter()- Returns:
- the canSetTransmitter
-
sendIr
public boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, Transmitter transmitter) throws HarcHardwareException - Specified by:
sendIrin interfaceIRawIrSender- Returns:
- if false, command failed.
- Throws:
NoSuchTransmitterExceptionHarcHardwareException
-
sendIr
public boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal, int count, LircTransmitter transmitter) throws HarcHardwareException - Throws:
HarcHardwareException
-
receive
public org.harctoolbox.ircore.IrSequence receive() throws HarcHardwareException, org.harctoolbox.ircore.OddSequenceLengthExceptionDescription copied from interface:IReceiveListens to the device and returns a sequence. Requires the device to be previously opened. Should itself neither open or close the device.- Specified by:
receivein interfaceIReceive- Returns:
- Captured sequence, or null by timeout.
- Throws:
HarcHardwareException- if the device is not in valid/open state.org.harctoolbox.ircore.OddSequenceLengthException
-
stopReceive
public boolean stopReceive()Description copied from interface:IReceiveSignals the receiving device that it should stop receiving. May not be implemented in all hardware.- Specified by:
stopReceivein interfaceIReceive- Returns:
- status
-
stopIr
Description copied from interface:IIrSenderStopStops ongoing IR transmission.- Specified by:
stopIrin interfaceIIrSenderStop- Returns:
- if false, command failed.
-
getVersion
Description copied from interface:IHarcHardwareReturns the hardware version (not the version of the driver software). May be null if no relevant information available.- Specified by:
getVersionin interfaceIHarcHardware- Returns:
- Version string. Semantics can vary.
- Throws:
IOException
-
setVerbose
public void setVerbose(boolean verbose) Description copied from interface:IHarcHardwareSets a verbosity flag, causing commands to be executed verbosely. Exact semantic depends on the implementation. Typically, all communication with the device is echoed to stderr.- Specified by:
setVerbosein interfaceIHarcHardware- Parameters:
verbose- on or off
-
setDebug
public void setDebug(int debug) Description copied from interface:IHarcHardwareSets a debug parameter. Exact semantic depends on the implementation.- Specified by:
setDebugin interfaceIHarcHardware
-
isValid
public boolean isValid()Description copied from interface:IHarcHardwareChecks validity of an instance. Exact meaning can vary.- Specified by:
isValidin interfaceIHarcHardware- Returns:
- validity of the instance.
-
setTimeout
Deprecated.Description copied from interface:IHarcHardwareSet timeout in milliseconds. Exact semantics may be dependent on the hardware.- Specified by:
setTimeoutin interfaceIHarcHardware- Parameters:
timeout- Timeout in milliseconds.- Throws:
IOException
-
setBeginTimeout
- Specified by:
setBeginTimeoutin interfaceIIrReader- Throws:
IOException
-
setCaptureMaxSize
public void setCaptureMaxSize(int integer) - Specified by:
setCaptureMaxSizein interfaceIIrReader
-
setEndingTimeout
public void setEndingTimeout(int integer) - Specified by:
setEndingTimeoutin interfaceIIrReader
-
open
Description copied from interface:IHarcHardwareOpens the device with previously set parameters.- Specified by:
openin interfaceIHarcHardware- Throws:
HarcHardwareException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getTransmitter
Description copied from interface:IRawIrSenderReturns a default Transmitter for the device. May be null if the device ignores the Transmitter argument in sendIr.- Specified by:
getTransmitterin interfaceIRawIrSender- Specified by:
getTransmitterin interfaceITransmitter- Returns:
- Transmitter
-
getTransmitter
Description copied from interface:ITransmitterParses the String argument, and returns a transmitter accordingly. Syntax and semantics may vary.- Specified by:
getTransmitterin interfaceITransmitter- Parameters:
connector- String describing desired port. Syntax is dependent on the implementing class.- Returns:
- Transmitter
- Throws:
NoSuchTransmitterException
-
getTransmitter
- Throws:
NoSuchTransmitterException
-
getTransmitterNames
Description copied from interface:ITransmitterReturn possible name of transmitters, that are guaranteed to work with the getTransmitter(String). This may be generated by inquiring the device, producing correct result, or it may be some static function, describing transmitters not necessarily present on the actually deployed device.- Specified by:
getTransmitterNamesin interfaceITransmitter- Returns:
- Array of strings that are guaranteed to work with the getTransmitter(String)
-
toString
-
capture
public org.harctoolbox.ircore.ModulatedIrSequence capture() throws HarcHardwareException, org.harctoolbox.ircore.OddSequenceLengthExceptionDescription copied from interface:ICaptureListens to the device and returns a sequence. Requires the device to be previously opened. Should itself neither open or close the device.- Specified by:
capturein interfaceICapture- Returns:
- Captured sequence, or null by timeout.
- Throws:
HarcHardwareException- if the device is not in valid/open state.org.harctoolbox.ircore.OddSequenceLengthException
-
stopCapture
public boolean stopCapture()Description copied from interface:ICaptureSignals the capturing device that it should stop capturing. May not be implemented in all hardware.- Specified by:
stopCapturein interfaceICapture- Returns:
- status
-