T - public class GirsClient<T extends ICommandLineDevice & IHarcHardware> extends Object implements IHarcHardware, IReceive, IRawIrSender, IRawIrSenderRepeat, IRemoteCommandIrSender, IIrSenderStop, ITransmitter, ICapture, ICommandLineDevice
repeatMaxrepeatMaxdefaultBeginTimeout, defaultCaptureMaxSize, defaultEndTimeout| Constructor and Description |
|---|
GirsClient(T hardware) |
| Modifier and Type | Method and Description |
|---|---|
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 |
getEndTimeout() |
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 |
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.
|
IrSequence |
receive()
Listens to the device and returns a sequence.
|
void |
reset() |
boolean |
sendIr(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(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 |
setEndTimeout(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(boolean val) |
void |
setVerbosity(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 |
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 setUseReceiveForCapture(boolean val)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic String getVersion() throws IOException
IHarcHardwaregetVersion in interface IHarcHardwareIOExceptionpublic void setVerbosity(boolean verbose)
IHarcHardwaresetVerbosity 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 getEndTimeout()
public void setEndTimeout(int endingTimeout)
setEndTimeout 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 void setFallbackFrequency(int fallbackFrequency)
fallbackFrequency - the fallbackFrequency to setpublic boolean sendIr(IrSignal irSignal, int count, Transmitter transmitter) throws NoSuchTransmitterException, IrpMasterException, IOException
sendIr in interface IRawIrSenderNoSuchTransmitterExceptionIrpMasterExceptionIOExceptionpublic void open()
throws IOException,
HarcHardwareException
IHarcHardwareopen in interface IHarcHardwareIOExceptionHarcHardwareExceptionpublic void waitFor(String goal, String areUThere, int delay, int tries) throws IOException, HarcHardwareException
IOExceptionHarcHardwareExceptionpublic ModulatedIrSequence capture() throws IOException, HarcHardwareException, IrpMasterException
ICapturecapture in interface ICaptureIOExceptionHarcHardwareException - if the device is not in valid/open state.IrpMasterExceptionpublic boolean stopCapture()
ICapturestopCapture in interface ICapturepublic IrSequence receive() throws HarcHardwareException, IOException, IrpMasterException
IReceivereceive in interface IReceiveHarcHardwareException - if the device is not in valid/open state.IOExceptionIrpMasterExceptionpublic boolean stopReceive()
IReceivestopReceive in interface IReceivepublic void reset()
throws IOException
IOExceptionpublic void sendString(String cmd) throws IOException
ICommandLineDevicesendString in interface ICommandLineDevicecmd - Command string to be sent.IOExceptionpublic 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(IrSignal irSignal, Transmitter transmitter) throws NoSuchTransmitterException, IOException, IrpMasterException
IRawIrSenderRepeatsendIrRepeat in interface IRawIrSenderRepeatNoSuchTransmitterExceptionIOExceptionIrpMasterExceptionpublic 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 © 2016. All rights reserved.