public class GlobalCache extends Object implements IHarcHardware, IRawIrSender, IIrSenderStop, ITransmitter, ICapture, IWeb
Modifier and Type | Class and Description |
---|---|
static class |
GlobalCache.GlobalCacheIrTransmitter |
static class |
GlobalCache.IrConfiguration
Possible arguments to the set_IR command.
|
static class |
GlobalCache.ModuleType |
class |
GlobalCache.SerialPort |
Modifier and Type | Field and Description |
---|---|
static int |
connectorMin |
static int |
connectorsPerModule |
static String |
defaultGlobalCacheIP |
static int |
defaultGlobalCachePort |
static int |
maxCompressedLetters |
static String |
sendIrPrefix |
repeatMax
defaultBeginTimeout, defaultCaptureMaxSize, defaultEndTimeout
Constructor and Description |
---|
GlobalCache(String hostname) |
GlobalCache(String hostname,
boolean verbose) |
GlobalCache(String hostname,
boolean verbose,
boolean compressed) |
GlobalCache(String hostIp,
boolean verbose,
int timeout) |
GlobalCache(String hostIp,
boolean verbose,
int timeout,
boolean compressed) |
Modifier and Type | Method and Description |
---|---|
ModulatedIrSequence |
capture()
Listens to the device and returns a sequence.
|
void |
close() |
String[] |
getDevices() |
String |
getIp() |
String |
getIr(int module,
int connector) |
ArrayList<Integer> |
getIrModules() |
String |
getNet() |
ArrayList<Integer> |
getRelayModules() |
String |
getSerial() |
String |
getSerial(int module) |
ArrayList<Integer> |
getSerialModules() |
GlobalCache.SerialPort |
getSerialPort(int portNumber)
Returns a serial port from the GlobalCache.
|
int |
getState(int connector) |
int |
getState(int module,
int connector) |
GlobalCache.GlobalCacheIrTransmitter |
getTransmitter()
Returns a default Transmitter for the device.
|
GlobalCache.GlobalCacheIrTransmitter |
getTransmitter(String str)
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.
|
String |
getVersion()
Returns the hardware version (not the version of the driver software).
|
String |
getVersion(int module) |
boolean |
isValid()
Tries to identify instances that are not valid.
|
static AmxBeaconListener.Node |
listenBeacon() |
static AmxBeaconListener.Node |
listenBeacon(int timeout) |
static void |
main(String[] args) |
static AmxBeaconListener |
newListener(AmxBeaconListener.Callback callback,
boolean debug) |
GlobalCache.GlobalCacheIrTransmitter |
newTransmitter(int module,
int port) |
void |
open()
Opens the device with previously set parameters.
|
static IrSignal |
parse(String gcString)
Parses a string intended as command to a GlobalCache and return it as a IrSignal.
|
boolean |
pulseState(int connector) |
boolean |
pulseState(int module,
int connector) |
boolean |
sendCcf(String ccfString,
int count,
Transmitter transmitter) |
boolean |
sendCcfRepeat(String ccfString,
Transmitter transmitter) |
boolean |
sendIr(IrSignal code) |
boolean |
sendIr(IrSignal code,
int connector) |
boolean |
sendIr(IrSignal code,
int count,
int connector) |
boolean |
sendIr(IrSignal code,
int count,
int module,
int connector) |
boolean |
sendIr(IrSignal code,
int count,
Transmitter transmitter) |
boolean |
sendIr(String cmd) |
boolean |
sendIr(String ccf,
int count,
int module,
int connector) |
String |
sendIrString(IrSignal code,
int count,
int module,
int connector) |
static String |
sendIrString(IrSignal code,
int count,
int module,
int connector,
int sendIndex,
boolean compressed)
Formats a string suitable for sending to a GlobalCache.
|
void |
setBeginTimeout(int integer) |
void |
setBlink(int arg) |
void |
setCaptureMaxSize(int integer) |
void |
setCompressed(boolean compressed) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setEndTimeout(int integer) |
String |
setIr(int module,
int connector,
GlobalCache.IrConfiguration mode) |
String |
setIr(int module,
int connector,
String modestr) |
String |
setNet(String arg) |
String |
setSerial(int baudrate) |
String |
setSerial(int module,
int baudrate) |
String |
setSerial(int module,
String arg) |
String |
setSerial(String arg) |
boolean |
setState(int connector,
boolean onOff) |
boolean |
setState(int connector,
int state) |
boolean |
setState(int module,
int connector,
int state) |
void |
setTimeout(int timeout)
Set timeout in milliseconds.
|
void |
setVerbosity(boolean verbosity)
Sets a verbosity flag, causing commands to be executed verbosely.
|
boolean |
stopCapture()
Signals the capturing device that it should stop capturing.
|
boolean |
stopIr(int module,
int connector) |
boolean |
stopIr(Transmitter transmitter)
Stops ongoing IR transmission.
|
boolean |
toggleState(int connector) |
boolean |
toggleState(int module,
int connector) |
public static final String defaultGlobalCacheIP
public static final int defaultGlobalCachePort
public static final String sendIrPrefix
public static final int connectorMin
public static final int connectorsPerModule
public static final int maxCompressedLetters
public GlobalCache(String hostIp, boolean verbose, int timeout, boolean compressed) throws UnknownHostException, IOException
UnknownHostException
IOException
public GlobalCache(String hostIp, boolean verbose, int timeout) throws UnknownHostException, IOException
UnknownHostException
IOException
public GlobalCache(String hostname) throws UnknownHostException, IOException
UnknownHostException
IOException
public GlobalCache(String hostname, boolean verbose, boolean compressed) throws UnknownHostException, IOException
UnknownHostException
IOException
public GlobalCache(String hostname, boolean verbose) throws UnknownHostException, IOException
UnknownHostException
IOException
public static String sendIrString(IrSignal code, int count, int module, int connector, int sendIndex, boolean compressed) throws NoSuchTransmitterException
code
- count
- module
- connector
- sendIndex
- compressed
- NoSuchTransmitterException
public static AmxBeaconListener.Node listenBeacon(int timeout)
public static AmxBeaconListener.Node listenBeacon()
public static AmxBeaconListener newListener(AmxBeaconListener.Callback callback, boolean debug)
public static IrSignal parse(String gcString)
gcString
- public static void main(String[] args)
public URI getUri(String user, String password)
IWeb
public GlobalCache.SerialPort getSerialPort(int portNumber) throws NoSuchTransmitterException
portNumber
- 1-based port number, i.e. use 1 for first, not 0.NoSuchTransmitterException
public GlobalCache.GlobalCacheIrTransmitter getTransmitter(String str) throws NoSuchTransmitterException
ITransmitter
getTransmitter
in interface ITransmitter
str
- String describing desired port. Syntax is dependent on the implementing class.NoSuchTransmitterException
public GlobalCache.GlobalCacheIrTransmitter getTransmitter()
IRawIrSender
getTransmitter
in interface IRawIrSender
getTransmitter
in interface ITransmitter
public GlobalCache.GlobalCacheIrTransmitter newTransmitter(int module, int port) throws NoSuchTransmitterException
NoSuchTransmitterException
public String[] getTransmitterNames()
ITransmitter
getTransmitterNames
in interface ITransmitter
public void setTimeout(int timeout)
IHarcHardware
setTimeout
in interface IHarcHardware
timeout
- Timeout in milliseconds.public final void open() throws UnknownHostException, IOException
IHarcHardware
open
in interface IHarcHardware
IOException
UnknownHostException
public String getIp()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void setVerbosity(boolean verbosity)
IHarcHardware
setVerbosity
in interface IHarcHardware
verbosity
- on or offpublic void setDebug(int debug)
IHarcHardware
setDebug
in interface IHarcHardware
public void setCompressed(boolean compressed)
public boolean stopIr(int module, int connector) throws IOException, NoSuchTransmitterException
public boolean stopIr(Transmitter transmitter) throws IOException, NoSuchTransmitterException
IIrSenderStop
stopIr
in interface IIrSenderStop
IOException
NoSuchTransmitterException
public boolean sendIr(String cmd) throws IOException
IOException
public String sendIrString(IrSignal code, int count, int module, int connector) throws NoSuchTransmitterException
NoSuchTransmitterException
public boolean sendIr(IrSignal code, int count, int module, int connector) throws NoSuchTransmitterException, IOException
public boolean sendIr(IrSignal code, int count, int connector) throws IOException, NoSuchTransmitterException
public boolean sendIr(IrSignal code, int connector) throws IOException, NoSuchTransmitterException
public boolean sendIr(IrSignal code) throws IOException, NoSuchTransmitterException
public boolean sendIr(IrSignal code, int count, Transmitter transmitter) throws NoSuchTransmitterException, IOException
sendIr
in interface IRawIrSender
NoSuchTransmitterException
IOException
public boolean sendIr(String ccf, int count, int module, int connector) throws IrpMasterException, NoSuchTransmitterException, IOException
public boolean sendCcf(String ccfString, int count, Transmitter transmitter) throws IOException, IrpMasterException, NoSuchTransmitterException
public boolean sendCcfRepeat(String ccfString, Transmitter transmitter) throws IOException, IrpMasterException, NoSuchTransmitterException
public String[] getDevices()
public String getVersion(int module) throws IOException
IOException
public String getVersion() throws IOException
IHarcHardware
getVersion
in interface IHarcHardware
IOException
public String getNet() throws IOException
IOException
public String setNet(String arg) throws IOException
IOException
public String getIr(int module, int connector) throws IOException, NoSuchTransmitterException
public String setIr(int module, int connector, String modestr) throws IOException, NoSuchTransmitterException
public String setIr(int module, int connector, GlobalCache.IrConfiguration mode) throws IOException, NoSuchTransmitterException
public String getSerial(int module) throws IOException
IOException
public String getSerial() throws IOException
IOException
public String setSerial(int module, String arg) throws IOException
IOException
public String setSerial(String arg) throws IOException
IOException
public String setSerial(int module, int baudrate) throws IOException
IOException
public String setSerial(int baudrate) throws IOException
IOException
public int getState(int module, int connector) throws IOException, NoSuchTransmitterException
public int getState(int connector) throws IOException, NoSuchTransmitterException
public boolean toggleState(int module, int connector) throws IOException, NoSuchTransmitterException
public boolean toggleState(int connector) throws IOException, NoSuchTransmitterException
public boolean setState(int module, int connector, int state) throws IOException, NoSuchTransmitterException
public boolean setState(int connector, int state) throws IOException, NoSuchTransmitterException
public boolean setState(int connector, boolean onOff) throws IOException, NoSuchTransmitterException
public boolean pulseState(int module, int connector) throws NoSuchTransmitterException, IOException
module
- connector
- IOException
NoSuchTransmitterException
public boolean pulseState(int connector) throws NoSuchTransmitterException, IOException
connector
- IOException
NoSuchTransmitterException
public void setBlink(int arg) throws IOException
IOException
public boolean isValid()
IHarcHardware
isValid
in interface IHarcHardware
public ModulatedIrSequence capture() throws HarcHardwareException
ICapture
capture
in interface ICapture
HarcHardwareException
- if the device is not in valid/open state.public boolean stopCapture()
ICapture
stopCapture
in interface ICapture
public void setBeginTimeout(int integer) throws IOException
setBeginTimeout
in interface IIrReader
IOException
public void setCaptureMaxSize(int integer)
setCaptureMaxSize
in interface IIrReader
public void setEndTimeout(int integer)
setEndTimeout
in interface IIrReader
Copyright © 2016. All rights reserved.