SunSPOT API V6.0


com.sun.spot.resources.transducers
Interface ITransducer

All Superinterfaces:
IResource
All Known Subinterfaces:
IAccelerometer3D, IAccelerometer3D, IAnalogInput, IInputPin, IInputPin, IIOPin, IIOPin, ILed, ILed, ILightSensor, ILightSensor, IOutputPin, IOutputPin, IScalarInput, IServo, IServo, ISwitch, ISwitch, ITemperatureInput, ITemperatureInput, IToneGenerator, IToneGenerator, ITriColorLED, ITriColorLED, ITriColorLightSensor
All Known Implementing Classes:
Accelerometer3D, ADJDS311TriColorLightSensor, AnalogInput, BinaryScalar, InfraRed, InputPin, InvertingInputPin, InvertingOutputPin, IOPin, LightSensor, LIS3L02AQAccelerometer, MMA7455LAccelerometer, OutputPin, ScalarInput, Servo, Switch, TemperatureInput, ToneGenerator, TriColorLED

public interface ITransducer
extends IResource

Provide basic metadata for a sensor or actuator.

Most metadata associated with a transducer should just be put into tags so that it can be searched for when doing a resource lookup. For example: name, vendor, model, version, location, latitude, longitude.

Some other metadata is defined by the API for the specific transducer. For example: units, scale, data type, etc.

Some other metadata depends on the implementing class so needs to be available via the get methods defined for ITransducer:
   description, measurement ranges, and maximum sampling rate.
plus other implemented interfaces like IMeasurementInfo:
   minimum value, maximum value, resolution and accuracy,
or IMeasurementRange:
   number available ranges, current range, set range, min/max for range

Author:
Ron Goldman

Method Summary
 SensorEvent createSensorEvent()
          Create a SensorEvent of the appropriate type for this sensor.
 String getDescription()
          This method returns a readable description of the sensor.
 double getMaxSamplingRate()
          Return the maximum sampling rate per second for this sensor.
 void saveEventState(SensorEvent evt)
          Save the current sensor state in the specified event.
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 

Method Detail

getDescription

String getDescription()
This method returns a readable description of the sensor. The description should tell the essentials of the sensor, including at least the sensor type (accelerometer, microphone, thermometer). The returned string MUST not be null or an empty string.

Returns:
the description of the sensor

getMaxSamplingRate

double getMaxSamplingRate()
Return the maximum sampling rate per second for this sensor.

Returns:
the maximum sampling rate per second for this sensor or 0 if not applicable.

createSensorEvent

SensorEvent createSensorEvent()
Create a SensorEvent of the appropriate type for this sensor.

Returns:
a SensorEvent of the appropriate type for this sensor.

saveEventState

void saveEventState(SensorEvent evt)
Save the current sensor state in the specified event.

Parameters:
evt - the event to store the sensor state in

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.