public class IrTrans extends Object implements IHarcHardware, IRawIrSender, ITransmitter, IWeb
Modifier and Type | Class and Description |
---|---|
static class |
IrTrans.Interface
Interface that can be used to command an IrTrans unit
|
static class |
IrTrans.IrTransTransmitter |
static class |
IrTrans.Led
IR LEDs on the IrTrans
|
Modifier and Type | Field and Description |
---|---|
static String |
defaultIrTransIP |
protected static int |
defaultTimeout |
protected static int |
dummyDelay |
protected InetAddress |
inetAddress |
protected IrTrans.Interface |
interfaze |
protected String |
irTransIP |
static int |
portNumber
port number, not possible to change.
|
protected int |
timeout |
protected boolean |
verbose |
repeatMax
Constructor and Description |
---|
IrTrans(String hostname) |
IrTrans(String hostname,
boolean verbose) |
IrTrans(String hostname,
boolean verbose,
int timeout) |
IrTrans(String hostname,
boolean verbose,
int timeout,
IrTrans.Interface interfaze) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
IrTrans.IrTransTransmitter |
getTransmitter()
Returns a default Transmitter for the device.
|
IrTrans.IrTransTransmitter |
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).
|
URI |
getUri(String user,
String password)
Returns an URI to be used for browsing the device, possibly containing user and password information.
|
protected boolean |
getUrl(String url) |
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) |
IrTrans.IrTransTransmitter |
newTransmitter(IrTrans.Led led) |
void |
open()
Opens the device with previously set parameters.
|
boolean |
sendCcf(String ccf,
int count,
IrTrans.Led led) |
boolean |
sendCcf(String ccf,
int count,
Transmitter transmitter) |
boolean |
sendCcfRepeat(String ccf,
Transmitter transmitter) |
protected String |
sendCommand(String cmd) |
protected boolean |
sendCommandUdp(String cmd) |
boolean |
sendIr(IrSignal code,
int count,
IrTrans.Led led) |
boolean |
sendIr(IrSignal code,
int count,
Transmitter transmitter) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setTimeout(int timeout)
Set timeout in milliseconds.
|
void |
setVerbosity(boolean verbosity)
Sets a verbosity flag, causing commands to be executed verbosely.
|
public static final String defaultIrTransIP
protected static final int dummyDelay
protected static final int defaultTimeout
public static final int portNumber
protected int timeout
protected String irTransIP
protected InetAddress inetAddress
protected boolean verbose
protected IrTrans.Interface interfaze
public IrTrans(String hostname, boolean verbose, int timeout, IrTrans.Interface interfaze) throws UnknownHostException
hostname
- verbose
- timeout
- interfaze
- UnknownHostException
public IrTrans(String hostname, boolean verbose, int timeout) throws UnknownHostException
UnknownHostException
public IrTrans(String hostname, boolean verbose) throws UnknownHostException
UnknownHostException
public IrTrans(String hostname) throws UnknownHostException
UnknownHostException
public static void main(String[] args)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public URI getUri(String user, String password)
IWeb
public void open()
IHarcHardware
open
in interface IHarcHardware
public void setDebug(int debug)
IHarcHardware
setDebug
in interface IHarcHardware
public IrTrans.IrTransTransmitter getTransmitter()
IRawIrSender
getTransmitter
in interface IRawIrSender
getTransmitter
in interface ITransmitter
public IrTrans.IrTransTransmitter newTransmitter(IrTrans.Led led)
public IrTrans.IrTransTransmitter getTransmitter(String port) throws NoSuchTransmitterException
ITransmitter
getTransmitter
in interface ITransmitter
port
- String describing desired port. Syntax is dependent on the implementing class.NoSuchTransmitterException
public String[] getTransmitterNames()
ITransmitter
getTransmitterNames
in interface ITransmitter
public boolean isValid()
IHarcHardware
isValid
in interface IHarcHardware
public void setVerbosity(boolean verbosity)
IHarcHardware
setVerbosity
in interface IHarcHardware
verbosity
- on or offpublic void setTimeout(int timeout)
IHarcHardware
setTimeout
in interface IHarcHardware
timeout
- Timeout in milliseconds.protected String sendCommand(String cmd) throws IOException
IOException
public String getVersion() throws IOException
IHarcHardware
getVersion
in interface IHarcHardware
IOException
protected boolean getUrl(String url) throws MalformedURLException, IOException
MalformedURLException
IOException
protected boolean sendCommandUdp(String cmd) throws IOException
IOException
public boolean sendCcf(String ccf, int count, IrTrans.Led led) throws IOException
IOException
public boolean sendCcf(String ccf, int count, Transmitter transmitter) throws IOException, NoSuchTransmitterException
public boolean sendCcfRepeat(String ccf, Transmitter transmitter) throws IOException, NoSuchTransmitterException
public boolean sendIr(IrSignal code, int count, IrTrans.Led led) throws IncompatibleArgumentException, IOException
public boolean sendIr(IrSignal code, int count, Transmitter transmitter) throws IrpMasterException, IOException, NoSuchTransmitterException
sendIr
in interface IRawIrSender
IrpMasterException
IOException
NoSuchTransmitterException
Copyright © 2016. All rights reserved.