Class DeviceMonitor
java.lang.Object
com.dalsemi.onewire.application.monitor.AbstractDeviceMonitor
com.dalsemi.onewire.application.monitor.DeviceMonitor
- All Implemented Interfaces:
Runnable
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.
-
Field Summary
Fields inherited from class com.dalsemi.onewire.application.monitor.AbstractDeviceMonitor
adapter, deviceAddressHash, deviceContainerHash, hasCompletelyStopped, isRunning, keepRunning, listeners, max_error_count, max_state_count, startRunning, sync_flag
-
Constructor Summary
ConstructorDescriptionDeviceMonitor
(DSPortAdapter adapter) Create a simple monitor that does not search branches -
Method Summary
Modifier and TypeMethodDescriptiongetDevicePath
(Long address) Returns the OWPath of the device with the given address.boolean
See if Gets this monitor to search for alarming parts.void
Performs a search of the 1-Wire network without searching branchesvoid
setAdapter
(DSPortAdapter adapter) Sets this monitor to search a new DSPortAdaptervoid
setDoAlarmSearch
(boolean findAlarmingParts) Sets this monitor to search for alarming parts.Methods inherited from class com.dalsemi.onewire.application.monitor.AbstractDeviceMonitor
addDeviceMonitorEventListener, cleanUpStaleContainerReferences, cleanUpStalePathReferences, fireArrivalEvent, fireDepartureEvent, getAdapter, getAllAddresses, getDeviceContainer, getDeviceContainer, getDeviceContainer, getDeviceContainer, getDevicePath, getDevicePath, getDevicePath, getMaxErrorCount, getMaxStateCount, isMonitorRunning, killMonitor, msSleep, pauseMonitor, putDeviceContainer, putDeviceContainer, putDeviceContainer, putDeviceContainer, resetSearch, resumeMonitor, run, setMaxErrorCount, setMaxStateCount
-
Constructor Details
-
DeviceMonitor
Create a simple monitor that does not search branches- Parameters:
adapter
- the DSPortAdapter this monitor should search
-
-
Method Details
-
setAdapter
Sets this monitor to search a new DSPortAdapter- Specified by:
setAdapter
in classAbstractDeviceMonitor
- Parameters:
adapter
- the DSPortAdapter this monitor should search
-
getDevicePath
Returns the OWPath of the device with the given address.- Specified by:
getDevicePath
in classAbstractDeviceMonitor
- 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 classAbstractDeviceMonitor
- Parameters:
arrivals
- A vector of Long objects, represent new arrival addresses.departures
- A vector of Long objects, represent departed addresses.- Throws:
OneWireException
OneWireIOException
-