|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.system.DriverAdapter
com.sentilla.system.SensorDriver<Q>
public abstract class SensorDriver<Q extends Quantity>
Create new Sensor
system objects.
Programmers are recommended to use the static create()
function to
acquire a sensor instance for attached peripherals and devices in a platform-independent
manner.
Information for common sensors, the recommended Quantity type, default sensor units, and the platform-independent driver name for that sensor are shown in the table below.
Sensor type Quantity Class Units Driver Name Voltage ElectricPotential Volts "volt" Temperature Temperature Celsius "temp" Light Illuminance lux "light" Relative humidity Dimensionless Percent "hum"
When building a new driver that extends SensorDriver, the classes in
the com.sentilla.measure.unit
are useful for driver builders
to provide the functions required by Measurable
and Comparable
.
required by Sensor
implementations.
Note: Any platform device must implement a driver for that device. The device driver for the platform must implement all the abstract action function calls defined in its respective Driver, in this case, all sensors must extend and implement function calls in SensorDriver and Sensor.
Quantity
,
Sensor
,
com.sentilla.measure.unit
Field Summary |
---|
Fields inherited from class com.sentilla.system.DriverAdapter |
---|
m_nextDriver |
Constructor Summary | |
---|---|
SensorDriver()
|
Method Summary | ||
---|---|---|
static
|
create(String driver,
Class<Q> quantityClass)
Create a Sensor object for a specific type of sensor with measureable Quantity Q. |
|
abstract Class<Q> |
getQuantityClass()
Get the type of quantity that this sensor provides. |
|
abstract Sensor<Q> |
newSensor()
Creates a new sensor object of quantity Q. |
Methods inherited from class com.sentilla.system.DriverAdapter |
---|
getDriverName, getNextDriver, setNextDriver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SensorDriver()
Method Detail |
---|
public abstract Sensor<Q> newSensor()
public abstract Class<Q> getQuantityClass()
public static <Q extends Quantity> Sensor<Q> create(String driver, Class<Q> quantityClass)
Q
- Type of quantity that this sensor measuresdriver
- Name of the sensorquantityClass
- Class type for the desired measureable quantity
NoSuchDriverException
- when no driver with the given name and quantity exists
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |