Class DeviceMonitor

  • All Implemented Interfaces:
    java.lang.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 Detail

      • DeviceMonitor

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

      • 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​(java.lang.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​(java.util.Vector<java.lang.Long> arrivals,
                           java.util.Vector<java.lang.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