private class WSI603A.TemperatureTask
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private boolean |
initialize
Flag to initialize sensor.
|
private byte[] |
state
1-Wire device state.
|
private java.lang.String |
TEMPERATURE_NAME
Data name.
|
private double[] |
tValues
Temperature values for RMS calculation.
|
private int |
tValuesIndex
Temperature values index.
|
Modifier | Constructor and Description |
---|---|
private |
TemperatureTask() |
Modifier and Type | Method and Description |
---|---|
private double |
getDeviceTemperature()
Reads current temperature.
|
private double |
getRmsTemperature()
Spins reading the temperature until the RMS values are not greater
than a standard deviation of one degree Celsius.
|
private void |
initDevice()
Initializes the sensor for operation.
|
void |
run()
Gets the implementation specific read task data from the WSI603A and
posts it to the data exchange.
|
private final java.lang.String TEMPERATURE_NAME
private boolean initialize
private byte[] state
private final double[] tValues
private int tValuesIndex
public void run()
run
in interface java.lang.Runnable
private void initDevice() throws com.dalsemi.onewire.OneWireException, ServiceException
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.ServiceException
- if initialization fails.private double getDeviceTemperature() throws com.dalsemi.onewire.OneWireException
com.dalsemi.onewire.OneWireException
- if access fails.private double getRmsTemperature() throws com.dalsemi.onewire.OneWireException, ValueException
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.ValueException
- if timeout occurs waiting for RMS readings to
converge.