com.dalsemi.onewire.application.monitor
Class DeviceMonitor

java.lang.Object
  |
  +--com.dalsemi.onewire.application.monitor.AbstractDeviceMonitor
        |
        +--com.dalsemi.onewire.application.monitor.DeviceMonitor
All Implemented Interfaces:
Runnable

public class DeviceMonitor
extends AbstractDeviceMonitor

Class DeviceMonitor represents the monitor that searches the 1-Wire net for new arrivals. This monitor performs a simple search, meaning that no branches are explicitly traversed. If a branch is activated/deactivated between search cycles, this monitor will see the arrival/departure of new devices without reference to the branch which they lie on.

Version:
1.00
Author:
SH

Constructor Summary
DeviceMonitor(DSPortAdapter adapter)
          Create a simple monitor that does not search branches
 
Method Summary
 OWPath getDevicePath(Long address)
          Returns the OWPath of the device with the given address.
 void search(Vector arrivals, Vector departures)
          Performs a search of the 1-Wire network without searching branches
 void setAdapter(DSPortAdapter adapter)
          Sets this monitor to search a new DSPortAdapter
 
Methods inherited from class com.dalsemi.onewire.application.monitor.AbstractDeviceMonitor
addDeviceMonitorEventListener, cleanUpStaleContainerReferences, cleanUpStalePathReferences, getAdapter, getAllAddresses, getDeviceContainer, getDeviceContainer, getDeviceContainer, getDeviceContainer, getDevicePath, getDevicePath, getDevicePath, getMaxErrorCount, getMaxStateCount, isMonitorRunning, killMonitor, pauseMonitor, putDeviceContainer, putDeviceContainer, putDeviceContainer, putDeviceContainer, resetSearch, resumeMonitor, run, setMaxErrorCount, setMaxStateCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceMonitor

public DeviceMonitor(DSPortAdapter adapter)
Create a simple monitor that does not search branches
Parameters:
the - DSPortAdapter this monitor should search
Method Detail

setAdapter

public void setAdapter(DSPortAdapter adapter)
Sets this monitor to search a new DSPortAdapter
Overrides:
setAdapter in class AbstractDeviceMonitor
Parameters:
the - DSPortAdapter this monitor should search

getDevicePath

public OWPath getDevicePath(Long address)
Returns the OWPath of the device with the given address.
Overrides:
getDevicePath in class AbstractDeviceMonitor
Parameters:
address - a Long object representing the address of the device
Returns:
The OWPath representing the network path to the device.

search

public void search(Vector arrivals,
                   Vector departures)
            throws OneWireException,
                   OneWireIOException
Performs a search of the 1-Wire network without searching branches
Overrides:
search in class AbstractDeviceMonitor
Parameters:
arrivals - A vector of Long objects, represent new arrival addresses.
departures - A vector of Long objects, represent departed addresses.


Copyright © 1999-2003 Dallas Semiconductor. All Rights Reserved.