com.dalsemi.onewire.utils
Class OneWireMonitor

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.dalsemi.onewire.utils.OneWireMonitor
All Implemented Interfaces:
java.lang.Runnable

public class OneWireMonitor
extends java.lang.Thread

This class allows an application to be notified of arriving and departing 1-Wire devices on a 1-Wire network.


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
OneWireMonitor(DSPortAdapter adapter)
          Create a 1-Wire monitoring object attached to the specified adapter.
 
Method Summary
 void addEventListener(OneWireMonitorEventListener owmel)
          Add an event listener that should be notified in case of 1-Wire event.
 void killMonitor()
           
 void removeEventListener(OneWireMonitorEventListener owmel)
          Remove an event listener.
 void run()
          Start up the show.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OneWireMonitor

public OneWireMonitor(DSPortAdapter adapter)
Create a 1-Wire monitoring object attached to the specified adapter.
Parameters:
adapter - 1-Wire adapter the monitor should use to scan for arrivals and departures of 1-Wire devices.
Method Detail

killMonitor

public void killMonitor()

addEventListener

public void addEventListener(OneWireMonitorEventListener owmel)
                      throws java.util.TooManyListenersException
Add an event listener that should be notified in case of 1-Wire event.
Parameters:
owmel - Event listener to add

removeEventListener

public void removeEventListener(OneWireMonitorEventListener owmel)
Remove an event listener. NOTE: If all event listeners are removed, 1-Wire network scanning will cease until
Parameters:
owmel - Event listener to remove

run

public void run()
Start up the show.
Overrides:
run in class java.lang.Thread