org.lirc
Class LIRCClient
java.lang.Object
|
+--org.lirc.LIRCClient
- public class LIRCClient
- extends java.lang.Object
Reads IR signals and fires LIRCEvents. A LIRCClient runs as
a daemon thread and invokes all LIRCListeners that have been
registered with it.
Usage:
LIRCClient c = new LIRClient();
LIRCListener l = new IRListener();
c.addLIRCListener(l);
...
c.stopListening();
...
private class IRListener implements LIRCListener{
public void IRReceived(LIRCEvent ir){
// do something with the LIRCEvent
}
}
- Version:
- $Revision: 1.6 $
- Author:
- Bjorn Bringert (bjorn@mumblebee.com)
Constructor Summary |
LIRCClient()
Connects to the lircd socket and starts listening for signals. |
Method Summary |
void |
addLIRCListener(LIRCListener l)
Adds an LIRCListener |
protected void |
fireIRReceived(int repeat,
java.lang.String name,
java.lang.String remote)
Notify all listeners that have registered interest for
notification on this event type. |
protected void |
fireIRReceived(java.lang.String code)
Notify all listeners that have registered interest for
notification on this event type. |
void |
removeLIRCListener(LIRCListener l)
Removes an LIRCListener |
void |
stopListening()
Stop listening for signals. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LIRCClient
public LIRCClient()
throws LIRCException
- Connects to the lircd socket and starts listening for signals.
stopListening
public void stopListening()
- Stop listening for signals. You can't restart it, create a new instead.
addLIRCListener
public void addLIRCListener(LIRCListener l)
- Adds an LIRCListener
removeLIRCListener
public void removeLIRCListener(LIRCListener l)
- Removes an LIRCListener
fireIRReceived
protected void fireIRReceived(java.lang.String code)
- Notify all listeners that have registered interest for
notification on this event type.
- Parameters:
code
- a String like the ones returned by readCode()
fireIRReceived
protected void fireIRReceived(int repeat,
java.lang.String name,
java.lang.String remote)
- Notify all listeners that have registered interest for
notification on this event type.