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.

  • Constructor Details

    • DeviceMonitor

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

    • setAdapter

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

      public OWPath getDevicePath(Long address)
      Returns the OWPath of the device with the given address.
      Specified by:
      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.
    • setDoAlarmSearch

      public void setDoAlarmSearch(boolean findAlarmingParts)
      Sets this monitor to search for alarming parts.
      Parameters:
      findAlarmingParts -
    • getDoAlarmSearch

      public boolean getDoAlarmSearch()
      See if Gets this monitor to search for alarming parts.
    • search

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