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 |
repeatMaxdefaultBeginTimeout, defaultCaptureMaxSize, defaultEndingTimeout| 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 |
|---|---|
org.harctoolbox.ircore.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() |
int |
getModuleSecondNumber(int moduleNumber) |
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 cardinal) |
GlobalCache.GlobalCacheIrTransmitter |
newTransmitter(int module,
int port) |
void |
open()
Opens the device with previously set parameters.
|
static org.harctoolbox.ircore.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(org.harctoolbox.ircore.IrSignal code) |
boolean |
sendIr(org.harctoolbox.ircore.IrSignal code,
int connector) |
boolean |
sendIr(org.harctoolbox.ircore.IrSignal code,
int count,
int connector) |
boolean |
sendIr(org.harctoolbox.ircore.IrSignal code,
int count,
int module,
int connector) |
boolean |
sendIr(org.harctoolbox.ircore.IrSignal code,
int count,
Transmitter transmitter) |
boolean |
sendIr(String cmd) |
boolean |
sendIr(String ccf,
int count,
int module,
int connector) |
String |
sendIrString(org.harctoolbox.ircore.IrSignal code,
int count,
int module,
int connector) |
static String |
sendIrString(org.harctoolbox.ircore.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 |
setEndingTimeout(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 |
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(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
UnknownHostExceptionIOExceptionpublic GlobalCache(String hostIp, boolean verbose, int timeout) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic GlobalCache(String hostname) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic GlobalCache(String hostname, boolean verbose, boolean compressed) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic GlobalCache(String hostname, boolean verbose) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic static String sendIrString(org.harctoolbox.ircore.IrSignal code, int count, int module, int connector, int sendIndex, boolean compressed) throws NoSuchTransmitterException
code - count - module - connector - sendIndex - compressed - NoSuchTransmitterExceptionpublic static AmxBeaconListener.Node listenBeacon(int timeout)
public static AmxBeaconListener.Node listenBeacon()
public static AmxBeaconListener newListener(AmxBeaconListener.Callback callback, boolean debug)
public static org.harctoolbox.ircore.IrSignal parse(String gcString) throws org.harctoolbox.ircore.InvalidArgumentException
gcString - org.harctoolbox.ircore.InvalidArgumentExceptionpublic static void main(String[] args) throws org.harctoolbox.ircore.InvalidArgumentException
org.harctoolbox.ircore.InvalidArgumentExceptionpublic URI getUri(String user, String password)
IWebpublic GlobalCache.SerialPort getSerialPort(int portNumber) throws NoSuchTransmitterException
portNumber - 1-based port number, i.e. use 1 for first, not 0.NoSuchTransmitterExceptionpublic GlobalCache.GlobalCacheIrTransmitter getTransmitter(String str) throws NoSuchTransmitterException
ITransmittergetTransmitter in interface ITransmitterstr - String describing desired port. Syntax is dependent on the implementing class.NoSuchTransmitterExceptionpublic GlobalCache.GlobalCacheIrTransmitter getTransmitter()
IRawIrSendergetTransmitter in interface IRawIrSendergetTransmitter in interface ITransmitterpublic GlobalCache.GlobalCacheIrTransmitter newTransmitter(int module, int port) throws NoSuchTransmitterException
NoSuchTransmitterExceptionpublic GlobalCache.GlobalCacheIrTransmitter newTransmitter(int cardinal) throws NoSuchTransmitterException
NoSuchTransmitterExceptionpublic String[] getTransmitterNames()
ITransmittergetTransmitterNames in interface ITransmitterpublic void setTimeout(int timeout)
IHarcHardwaresetTimeout in interface IHarcHardwaretimeout - Timeout in milliseconds.public final void open()
throws UnknownHostException,
IOException
IHarcHardwareopen in interface IHarcHardwareIOExceptionUnknownHostExceptionpublic String getIp()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void setVerbose(boolean verbose)
IHarcHardwaresetVerbose in interface IHarcHardwareverbose - on or offpublic void setDebug(int debug)
IHarcHardwaresetDebug in interface IHarcHardwarepublic void setCompressed(boolean compressed)
public boolean stopIr(int module,
int connector)
throws IOException,
NoSuchTransmitterException
public boolean stopIr(Transmitter transmitter) throws IOException, NoSuchTransmitterException
IIrSenderStopstopIr in interface IIrSenderStopIOExceptionNoSuchTransmitterExceptionpublic boolean sendIr(String cmd) throws IOException
IOExceptionpublic String sendIrString(org.harctoolbox.ircore.IrSignal code, int count, int module, int connector) throws NoSuchTransmitterException
NoSuchTransmitterExceptionpublic boolean sendIr(org.harctoolbox.ircore.IrSignal code,
int count,
int module,
int connector)
throws NoSuchTransmitterException,
IOException
public boolean sendIr(org.harctoolbox.ircore.IrSignal code,
int count,
int connector)
throws IOException,
NoSuchTransmitterException
public boolean sendIr(org.harctoolbox.ircore.IrSignal code,
int connector)
throws IOException,
NoSuchTransmitterException
public boolean sendIr(org.harctoolbox.ircore.IrSignal code)
throws IOException,
NoSuchTransmitterException
public boolean sendIr(org.harctoolbox.ircore.IrSignal code,
int count,
Transmitter transmitter)
throws NoSuchTransmitterException,
IOException
sendIr in interface IRawIrSenderNoSuchTransmitterExceptionIOExceptionpublic boolean sendIr(String ccf, int count, int module, int connector) throws org.harctoolbox.ircore.Pronto.NonProntoFormatException, org.harctoolbox.ircore.InvalidArgumentException, NoSuchTransmitterException, IOException
org.harctoolbox.ircore.Pronto.NonProntoFormatExceptionorg.harctoolbox.ircore.InvalidArgumentExceptionNoSuchTransmitterExceptionIOExceptionpublic boolean sendCcf(String ccfString, int count, Transmitter transmitter) throws org.harctoolbox.ircore.Pronto.NonProntoFormatException, org.harctoolbox.ircore.InvalidArgumentException, NoSuchTransmitterException, IOException
org.harctoolbox.ircore.Pronto.NonProntoFormatExceptionorg.harctoolbox.ircore.InvalidArgumentExceptionNoSuchTransmitterExceptionIOExceptionpublic boolean sendCcfRepeat(String ccfString, Transmitter transmitter) throws IOException, NoSuchTransmitterException, org.harctoolbox.ircore.Pronto.NonProntoFormatException, org.harctoolbox.ircore.InvalidArgumentException
IOExceptionNoSuchTransmitterExceptionorg.harctoolbox.ircore.Pronto.NonProntoFormatExceptionorg.harctoolbox.ircore.InvalidArgumentExceptionpublic String[] getDevices()
public String getVersion(int module) throws IOException
IOExceptionpublic String getVersion() throws IOException
IHarcHardwaregetVersion in interface IHarcHardwareIOExceptionpublic String getNet() throws IOException
IOExceptionpublic String setNet(String arg) throws IOException
IOExceptionpublic String getIr(int module, int connector) throws IOException, NoSuchTransmitterException
public int getModuleSecondNumber(int moduleNumber)
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
IOExceptionpublic String getSerial() throws IOException
IOExceptionpublic String setSerial(int module, String arg) throws IOException
IOExceptionpublic String setSerial(String arg) throws IOException
IOExceptionpublic String setSerial(int module, int baudrate) throws IOException
IOExceptionpublic String setSerial(int baudrate) throws IOException
IOExceptionpublic 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 - IOExceptionNoSuchTransmitterExceptionpublic boolean pulseState(int connector)
throws NoSuchTransmitterException,
IOException
connector - IOExceptionNoSuchTransmitterExceptionpublic void setBlink(int arg)
throws IOException
IOExceptionpublic boolean isValid()
IHarcHardwareisValid in interface IHarcHardwarepublic org.harctoolbox.ircore.ModulatedIrSequence capture()
throws HarcHardwareException,
org.harctoolbox.ircore.InvalidArgumentException
ICapturecapture in interface ICaptureHarcHardwareException - if the device is not in valid/open state.org.harctoolbox.ircore.OddSequenceLengthExceptionorg.harctoolbox.ircore.InvalidArgumentExceptionpublic boolean stopCapture()
ICapturestopCapture in interface ICapturepublic void setBeginTimeout(int integer)
throws IOException
setBeginTimeout in interface IIrReaderIOExceptionpublic void setCaptureMaxSize(int integer)
setCaptureMaxSize in interface IIrReaderpublic void setEndingTimeout(int integer)
setEndingTimeout in interface IIrReaderCopyright © 2020. All rights reserved.