uwcse.location.objects
Class SensorDriver

java.lang.Object
  |
  +--com.intel.research.rain.Service
        |
        +--uwcse.location.LocationService
              |
              +--uwcse.location.FusionClientService
                    |
                    +--uwcse.location.objects.SensorDriver
All Implemented Interfaces:
MessageHandler
Direct Known Subclasses:
AlienDriver, CricketDriver, LMS200Driver, LogReaderDriver, MoteDriver, NMEADriver, VersusDriver

public abstract class SensorDriver
extends FusionClientService

A SensorDriver is an abstract class implementing a driver to interact with location sensing hardware and generate Measurements.

Version:
$Revision: 1.2 $
Author:
Jeffrey Hightower
See Also:
Measurement

Nested Class Summary
 
Nested classes inherited from class uwcse.location.LocationService
LocationService.RediscoverServices
 
Field Summary
protected  Set m_measurementSinkServiceIDSet
           
protected static String SINK_DISCOVERY_QUERY
           
 
Fields inherited from class uwcse.location.FusionClientService
FUSION_DISCOVERY_QUERY, m_fusionServiceIDSet
 
Fields inherited from class uwcse.location.LocationService
CONFIG_FILENAME, MESSAGE_ELEMENT, MESSAGE_EXTENSION, RPC_ELEMENT, RPC_EXCEPTION_ELEMENT, RPC_EXTENSION, RPC_RESULT_ELEMENT
 
Constructor Summary
SensorDriver(String hardwareName)
          Create a new sensor driver.
SensorDriver(String hardwareName, Collection measurementSinkIDs)
          Create a new sensor driver which sends its measurements to the specified measurement sinks.
 
Method Summary
protected  void sendMeasurement(Measurement meas)
          Send a Measurement to all interested services.
protected  void withdraw()
          Supplement the inherited behavior to clear the list of measurement sink IDs and shutdown the heartbeat discovery thread when withdrawing from Rain.
 
Methods inherited from class uwcse.location.FusionClientService
callFusionServiceRpc, getFusionServiceIDSet
 
Methods inherited from class uwcse.location.LocationService
addObject, callLocationRpc, correctedTimeMillis, getObject, getSysclockError, handleTerminalCommand, multicastLocationMsg, multicastLocationMsgs, processLocationMsg, processLocationRpc, runTerminalCommandLoop, sendLocationMsg, sendLocationMsgs, setDescription
 
Methods inherited from class com.intel.research.rain.Service
getDaemon, getDispatcher, getServiceID, process, receive, setDaemon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINK_DISCOVERY_QUERY

protected static final String SINK_DISCOVERY_QUERY

m_measurementSinkServiceIDSet

protected Set m_measurementSinkServiceIDSet
Constructor Detail

SensorDriver

public SensorDriver(String hardwareName)
             throws RainException,
                    LocationException
Create a new sensor driver.

Parameters:
hardwareName - a string naming the hardware this driver is for.
Throws:
RainException
LocationException

SensorDriver

public SensorDriver(String hardwareName,
                    Collection measurementSinkIDs)
             throws RainException,
                    LocationException
Create a new sensor driver which sends its measurements to the specified measurement sinks. If the measurementSinkSet is null then the discovery service is used to provide dynamic late-binding to measurement sinks, other

Parameters:
hardwareName - a string naming the hardware this driver is for.
measurementSinkIDs - measurement sinks to receive measruements or null to perform late binding discovery when sending measurements
Throws:
RainException
LocationException
Method Detail

withdraw

protected void withdraw()
Supplement the inherited behavior to clear the list of measurement sink IDs and shutdown the heartbeat discovery thread when withdrawing from Rain.

Overrides:
withdraw in class FusionClientService

sendMeasurement

protected void sendMeasurement(Measurement meas)
                        throws RainException
Send a Measurement to all interested services.

Parameters:
meas - the Measurement to send to the sinks
Throws:
RainException


This documentation is for the Location Stack v0.8. The latest distribution, the documentation, and the list of contributors to the Location Stack can always be found at http://portolano.cs.washington.edu/projects/location/

© Copyright 2004 University of Washington CSE