1-Wire API for .NET Version 4.00
Public Member Functions | Protected Attributes

NetworkDeviceMonitor Class Reference

Class NetworkDeviceMonitor represents the monitor that searches the 1-Wire net, including the traversal of branches, looing for new arrivals and departures. More...

Inherits com::dalsemi::onewire::application::monitor::AbstractDeviceMonitor.

List of all members.

Public Member Functions

 NetworkDeviceMonitor (DSPortAdapter adapter)
 Create a complex monitor that does search branches.
void setAdapter (DSPortAdapter adapter)
 Sets this monitor to search a new DSPortAdapter.
void setBranchAutoSearching (boolean enabled)
 Indicates whether or not branches are automatically traversed.
boolean getBranchAutoSearching ()
 Indicates whether or not branches are automatically traversed.
void addBranch (OWPath path)
 Adds a branch for searching.
OWPath getDevicePath (Long address)
 Returns the OWPath of the device with the given address.
void cleanUpStalePathReferences ()
 The device monitor will internally cache OWPath objects for each 1-Wire device.
void search (Vector arrivals, Vector departures) throws OneWireException, OneWireIOException
 Performs a search of the 1-Wire network, with branch searching.

Protected Attributes

final Hashtable devicePathHash = new Hashtable()
 hashtable for holding the OWPath objects for each device container.
Vector paths = null
 A vector of paths, or branches, to search.
boolean branchAutoSearching = true
 indicates whether or not branches are automatically traversed

Detailed Description

Class NetworkDeviceMonitor represents the monitor that searches the 1-Wire net, including the traversal of branches, looing for new arrivals and departures.

Author:
SH
Version:
1.00

Constructor & Destructor Documentation

Create a complex monitor that does search branches.

Parameters:
theDSPortAdapter this monitor should search

Member Function Documentation

void addBranch ( OWPath  path)

Adds a branch for searching.

Must be used to traverse branches if auto-searching is disabled.

Parameters:
pathA branch to be searched during the next search routine
void cleanUpStalePathReferences ( )

The device monitor will internally cache OWPath objects for each 1-Wire device.

Use this method to clean up all stale OWPath objects. A stale path object is a OWPath which references a branching path to a 1-Wire device address which has not been seen by a recent search. This will be essential in a touch-contact environment which could run for some time and needs to conserve memory.

Reimplemented from AbstractDeviceMonitor.

boolean getBranchAutoSearching ( )

Indicates whether or not branches are automatically traversed.

If false, new branches must be indicated using the "addBranch" method.

Returns:
true if all branches are automatically traversed during a search operation.
OWPath getDevicePath ( Long  address) [virtual]

Returns the OWPath of the device with the given address.

Parameters:
addressa Long object representing the address of the device
Returns:
The OWPath representing the network path to the device.

Implements AbstractDeviceMonitor.

void search ( Vector  arrivals,
Vector  departures 
) throws OneWireException, OneWireIOException [virtual]

Performs a search of the 1-Wire network, with branch searching.

Parameters:
arrivalsA vector of Long objects, represent new arrival addresses.
departuresA vector of Long objects, represent departed addresses.

Implements AbstractDeviceMonitor.

void setAdapter ( DSPortAdapter  adapter) [virtual]

Sets this monitor to search a new DSPortAdapter.

Parameters:
theDSPortAdapter this monitor should search

Implements AbstractDeviceMonitor.

void setBranchAutoSearching ( boolean  enabled)

Indicates whether or not branches are automatically traversed.

If false, new branches must be indicated using the "addBranch" method.

Parameters:
enabledif true, all branches are automatically traversed during a search operation.

Member Data Documentation

final Hashtable devicePathHash = new Hashtable() [protected]

hashtable for holding the OWPath objects for each device container.


The documentation for this class was generated from the following file: