T - public class GirsClient<T extends ICommandLineDevice & IHarcHardware> extends Object implements IHarcHardware, IReceive, IRawIrSender, IRawIrSenderRepeat, IRemoteCommandIrSender, IIrSenderStop, ITransmitter, ICapture, ICommandLineDevice, Closeable
repeatMaxrepeatMaxdefaultBeginTimeout, defaultCaptureMaxSize, defaultEndingTimeout| Constructor and Description |
|---|
GirsClient(T hardware) |
| Modifier and Type | Method and Description |
|---|---|
org.harctoolbox.ircore.ModulatedIrSequence |
capture()
Listens to the device and returns a sequence.
|
void |
close() |
void |
flushInput() |
int |
getBeginTimeout() |
String[] |
getCommands(String remote)
Returns an array of command names for the remote given in the argument.
|
int |
getEndingTimeout() |
int |
getMaxCaptureLength() |
List<String> |
getModules() |
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 |
hasCaptureModule() |
boolean |
hasModule(String module) |
boolean |
isValid()
Tries to identify instances that are not valid.
|
static void |
main(String[] args)
Just for testing.
|
void |
open()
Opens the device with previously set parameters.
|
String |
readString()
Reads a line of text.
|
String |
readString(boolean wait)
Reads a line of text.
|
boolean |
ready()
Tells whether this stream is ready to be read.
|
org.harctoolbox.ircore.IrSequence |
receive()
Listens to the device and returns a sequence.
|
void |
reset() |
boolean |
sendIr(org.harctoolbox.ircore.IrSignal irSignal,
int count) |
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.
|
boolean |
sendIrRepeat(org.harctoolbox.ircore.IrSignal irSignal,
Transmitter transmitter)
Like sendCcf, but continues the transmission until interrupted by a stopIr command.
|
void |
sendString(String cmd)
Sends a command (a String) to the instance.
|
void |
setBeginTimeout(int beginTimeout) |
void |
setCaptureMaxSize(int maxCaptureLength) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setEndingTimeout(int endingTimeout) |
void |
setFallbackFrequency(int fallbackFrequency) |
void |
setLcd(String message) |
void |
setLcd(String message,
int x,
int y) |
void |
setLcdBacklight(boolean state) |
void |
setLcdBacklight(int flashTime) |
void |
setLed(int led,
boolean state) |
void |
setLed(int led,
int flashTime) |
void |
setLineEnding(String lineEnding) |
void |
setTimeout(int timeout)
Deprecated.
|
void |
setUseReceiveForCapture() |
void |
setUseReceiveForCapture(boolean val) |
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.
|
void |
testBase() |
void |
testCapture() |
void |
testLcd() |
void |
testLed() |
void |
testParameters() |
void |
testReceive() |
void |
testTransmit() |
void |
waitFor(String goal,
String areUThere,
int delay,
int tries) |
public GirsClient(T hardware) throws HarcHardwareException, IOException
HarcHardwareExceptionIOExceptionpublic static void main(String[] args)
args - the command line argumentspublic void testLcd()
throws IOException,
HarcHardwareException
IOExceptionHarcHardwareExceptionpublic void testBase()
throws IOException
IOExceptionpublic void testTransmit()
throws IOException,
HarcHardwareException
IOExceptionHarcHardwareExceptionpublic void testLed()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void testReceive()
throws HarcHardwareException,
IOException
HarcHardwareExceptionIOExceptionpublic void testCapture()
throws HarcHardwareException,
IOException,
org.harctoolbox.ircore.OddSequenceLengthException
HarcHardwareExceptionIOExceptionorg.harctoolbox.ircore.OddSequenceLengthExceptionpublic void testParameters()
throws IOException,
HarcHardwareException
IOExceptionHarcHardwareExceptionpublic void setUseReceiveForCapture(boolean val)
throws HarcHardwareException
HarcHardwareExceptionpublic void setUseReceiveForCapture()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic String getVersion() throws IOException
IHarcHardwaregetVersion in interface IHarcHardwareIOExceptionpublic void setVerbose(boolean verbose)
IHarcHardwaresetVerbose in interface IHarcHardwareverbose - on or offpublic void setDebug(int debug)
IHarcHardwaresetDebug in interface IHarcHardware@Deprecated public void setTimeout(int timeout) throws IOException
IHarcHardwaresetTimeout in interface IHarcHardwaretimeout - Timeout in milliseconds.IOExceptionpublic int getBeginTimeout()
public void setBeginTimeout(int beginTimeout)
setBeginTimeout in interface IIrReaderbeginTimeout - the beginTimeout to setpublic int getMaxCaptureLength()
public void setCaptureMaxSize(int maxCaptureLength)
setCaptureMaxSize in interface IIrReadermaxCaptureLength - the maxCaptureLength to setpublic int getEndingTimeout()
public void setEndingTimeout(int endingTimeout)
setEndingTimeout in interface IIrReaderendingTimeout - the endingTimeout to setpublic void setLineEnding(String lineEnding)
lineEnding - the lineEnding to setpublic boolean isValid()
IHarcHardwareisValid in interface IHarcHardwarepublic boolean hasModule(String module)
public boolean hasCaptureModule()
public void setFallbackFrequency(int fallbackFrequency)
fallbackFrequency - the fallbackFrequency to setpublic boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal,
int count,
Transmitter transmitter)
throws IOException,
HarcHardwareException
sendIr in interface IRawIrSenderIOExceptionNoSuchTransmitterExceptionHarcHardwareExceptionpublic boolean sendIr(org.harctoolbox.ircore.IrSignal irSignal,
int count)
throws IOException,
HarcHardwareException
IOExceptionHarcHardwareExceptionpublic void open()
throws IOException,
HarcHardwareException
IHarcHardwareopen in interface IHarcHardwareIOExceptionHarcHardwareExceptionpublic void waitFor(String goal, String areUThere, int delay, int tries) throws IOException, HarcHardwareException
IOExceptionHarcHardwareExceptionpublic org.harctoolbox.ircore.ModulatedIrSequence capture()
throws IOException,
HarcHardwareException,
org.harctoolbox.ircore.OddSequenceLengthException
ICapturecapture in interface ICaptureIOExceptionHarcHardwareException - if the device is not in valid/open state.org.harctoolbox.ircore.OddSequenceLengthExceptionpublic boolean stopCapture()
ICapturestopCapture in interface ICapturepublic org.harctoolbox.ircore.IrSequence receive()
throws HarcHardwareException,
IOException
IReceivereceive in interface IReceiveHarcHardwareException - if the device is not in valid/open state.IOExceptionpublic boolean stopReceive()
IReceivestopReceive in interface IReceivepublic void reset()
throws IOException,
HarcHardwareException
IOExceptionHarcHardwareExceptionpublic void sendString(String cmd) throws IOException, HarcHardwareException
ICommandLineDevicesendString in interface ICommandLineDevicecmd - Command string to be sent.IOExceptionHarcHardwareExceptionpublic String readString() throws IOException
ICommandLineDevicereadString in interface ICommandLineDeviceIOExceptionpublic String readString(boolean wait) throws IOException
ICommandLineDevicereadString in interface ICommandLineDevicewait - if true, wait until something arrives, otherwise return null if nothing there.IOExceptionpublic boolean ready()
throws IOException
ICommandLineDeviceready in interface ICommandLineDeviceIOException - If an I/O error occurspublic void flushInput()
throws IOException
flushInput in interface ICommandLineDeviceIOExceptionpublic Transmitter getTransmitter()
IRawIrSendergetTransmitter in interface IRawIrSendergetTransmitter in interface IRemoteCommandIrSendergetTransmitter in interface ITransmitterpublic boolean stopIr(Transmitter transmitter) throws NoSuchTransmitterException, IOException
IIrSenderStopstopIr in interface IIrSenderStopNoSuchTransmitterExceptionIOExceptionpublic Transmitter getTransmitter(String connector) throws NoSuchTransmitterException
ITransmittergetTransmitter in interface ITransmitterconnector - String describing desired port. Syntax is dependent on the implementing class.NoSuchTransmitterExceptionpublic String[] getTransmitterNames()
ITransmittergetTransmitterNames in interface ITransmitterpublic boolean sendIrRepeat(org.harctoolbox.ircore.IrSignal irSignal,
Transmitter transmitter)
throws NoSuchTransmitterException,
IOException
IRawIrSenderRepeatsendIrRepeat in interface IRawIrSenderRepeatNoSuchTransmitterExceptionIOExceptionpublic String[] getRemotes() throws IOException
IRemoteCommandIrSendergetRemotes in interface IRemoteCommandIrSenderIOExceptionpublic String[] getCommands(String remote) throws IOException
IRemoteCommandIrSendergetCommands in interface IRemoteCommandIrSenderremote - The "remote" to search inIOExceptionpublic boolean sendIrCommand(String remote, String command, int count, Transmitter transmitter) throws IOException, NoSuchTransmitterException
IRemoteCommandIrSendersendIrCommand in interface IRemoteCommandIrSendercount - Number of times to repeat the commandIOExceptionNoSuchTransmitterExceptionpublic boolean sendIrCommandRepeat(String remote, String command, Transmitter transmitter) throws IOException, NoSuchTransmitterException
IRemoteCommandIrSendersendIrCommandRepeat in interface IRemoteCommandIrSenderIOExceptionNoSuchTransmitterExceptionpublic void setLed(int led,
boolean state)
throws IOException,
HarcHardwareException
IOExceptionHarcHardwareExceptionpublic void setLed(int led,
int flashTime)
public void setLcd(String message) throws IOException, HarcHardwareException
IOExceptionHarcHardwareExceptionpublic void setLcd(String message, int x, int y)
public void setLcdBacklight(boolean state)
public void setLcdBacklight(int flashTime)
Copyright © 2020. All rights reserved.