public class LircClient extends Object implements IHarcHardware, IRemoteCommandIrSender, IIrSenderStop, ITransmitter
| Modifier and Type | Class and Description |
|---|---|
static class |
LircClient.CommandList |
static class |
LircClient.CommandSendOnce |
static class |
LircClient.CommandSendStart |
static class |
LircClient.CommandSendStop |
static class |
LircClient.CommandSetTransmitters |
static class |
LircClient.CommandSimulate |
static class |
LircClient.CommandVersion |
| Modifier and Type | Field and Description |
|---|---|
static String |
defaultLircIP |
static int |
defaultTimeout |
static int |
lircDefaultPort |
repeatMax| Constructor and Description |
|---|
LircClient(String hostname) |
LircClient(String hostname,
boolean verbose) |
LircClient(String hostname,
boolean verbose,
int timeout) |
LircClient(String hostname,
int port,
boolean verbose,
int timeout) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
LircTransmitter |
getTransmitter()
Returns a default Transmitter for the device.
|
LircTransmitter |
getTransmitter(int portNo) |
LircTransmitter |
getTransmitter(String port)
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()
Dummy implementation, always returns true
|
static void |
main(String[] args) |
void |
open()
Opens the device with previously set parameters.
|
protected void |
readLoop() |
protected String[] |
sendCommand(String packet,
boolean oneWord) |
boolean |
sendIrCommand(String remote,
String command,
int count,
int connector) |
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 |
setDebug(int debug)
Sets a debug parameter.
|
void |
setTimeout(int timeout)
Set timeout in milliseconds.
|
boolean |
setTransmitters(boolean[] ports) |
boolean |
setTransmitters(int port) |
boolean |
setTransmitters(Transmitter transmitter)
Sends the SET_TRANSMITTER command to the LIRC server.
|
void |
setVerbose(boolean verbose)
Sets a verbosity flag, causing commands to be executed verbosely.
|
boolean |
stopIr(String remote,
String command,
int port) |
boolean |
stopIr(String remote,
String command,
Transmitter transmitter) |
boolean |
stopIr(Transmitter transmitter)
Stops ongoing IR transmission.
|
public static final int lircDefaultPort
public static final String defaultLircIP
public static final int defaultTimeout
public LircClient(String hostname, int port, boolean verbose, int timeout) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic LircClient(String hostname, boolean verbose, int timeout) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic LircClient(String hostname, boolean verbose) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic LircClient(String hostname) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic static void main(String[] args)
args - the command line arguments.public void close()
close in interface Closeableclose in interface AutoCloseablepublic void open()
IHarcHardwareopen in interface IHarcHardwarepublic LircTransmitter getTransmitter()
IRemoteCommandIrSendergetTransmitter in interface IRemoteCommandIrSendergetTransmitter in interface ITransmitterpublic LircTransmitter getTransmitter(int portNo) throws NoSuchTransmitterException
NoSuchTransmitterExceptionpublic LircTransmitter getTransmitter(String port) throws NoSuchTransmitterException
ITransmittergetTransmitter in interface ITransmitterport - String describing desired port. Syntax is dependent on the implementing class.NoSuchTransmitterExceptionpublic String[] getTransmitterNames()
ITransmittergetTransmitterNames in interface ITransmitterpublic void setVerbose(boolean verbose)
IHarcHardwaresetVerbose in interface IHarcHardwareverbose - on or offpublic void setDebug(int debug)
IHarcHardwaresetDebug in interface IHarcHardwarepublic void setTimeout(int timeout)
IHarcHardwaresetTimeout in interface IHarcHardwaretimeout - Timeout in milliseconds.protected void readLoop()
throws IOException
IOExceptionprotected final String[] sendCommand(String packet, boolean oneWord) throws IOException
IOExceptionpublic 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 sendIrCommand(String remote, String command, int count, int connector) throws IOException, NoSuchTransmitterException
public boolean sendIrCommandRepeat(String remote, String command, Transmitter transmitter) throws IOException, NoSuchTransmitterException
IRemoteCommandIrSendersendIrCommandRepeat in interface IRemoteCommandIrSenderIOExceptionNoSuchTransmitterExceptionpublic boolean stopIr(String remote, String command, Transmitter transmitter) throws IOException, NoSuchTransmitterException
public boolean stopIr(String remote, String command, int port) throws IOException, NoSuchTransmitterException
public boolean stopIr(Transmitter transmitter) throws IOException, NoSuchTransmitterException
IIrSenderStopstopIr in interface IIrSenderStopIOExceptionNoSuchTransmitterExceptionpublic String[] getRemotes() throws IOException
IRemoteCommandIrSendergetRemotes in interface IRemoteCommandIrSenderIOExceptionpublic String[] getCommands(String remote) throws IOException
IRemoteCommandIrSendergetCommands in interface IRemoteCommandIrSenderremote - The "remote" to search inIOExceptionpublic boolean setTransmitters(Transmitter transmitter) throws NoSuchTransmitterException, IOException
transmitter - IOExceptionNoSuchTransmitterExceptionpublic boolean setTransmitters(int port)
throws NoSuchTransmitterException,
IOException
public boolean setTransmitters(boolean[] ports)
throws NoSuchTransmitterException,
IOException
public String getVersion() throws IOException
IHarcHardwaregetVersion in interface IHarcHardwareIOExceptionpublic boolean isValid()
isValid in interface IHarcHardwareCopyright © 2020. All rights reserved.