com.dalsemi.onewire.container
Interface TemperatureContainer

All Superinterfaces:
OneWireSensor
All Known Implementing Classes:
OneWireContainer21, OneWireContainer10, OneWireContainer30, OneWireContainer26, OneWireContainer28

public interface TemperatureContainer
extends OneWireSensor

1-Wire temperature interface class for basic temperature measuring operations. This class should be implemented for each temperature type 1-Wire device.

Version:
0.00, 27 August 2000

Field Summary
static int ALARM_HIGH
          High alarm
static int ALARM_LOW
          Low Alarm
 
Method Summary
 void doTemperatureConvert(byte[] state)
          Perform an temperature conversion.
 double getMaxTemperature()
          Query to get the maximum temperature in degrees C.
 double getMinTemperature()
          Query to get the minimum temperature in degrees C.
 double getTemperature(byte[] state)
          This method extracts the Temperature Value in degrees C from the state data retrieved from the 'readDevice()' method.
 double getTemperatureAlarm(int alarmType, byte[] state)
          This method extracts the specified Alarm value in degrees C from the state data retrieved from the 'readDevice()' method.
 double getTemperatureAlarmResolution()
          Query to get the high/low resolution in degrees C.
 double getTemperatureResolution(byte[] state)
          This method extracts the current resolution in degrees C from the state data retrieved from the 'readDevice()' method.
 double[] getTemperatureResolutions()
          Query to get an array of available resolutions in degrees C.
 boolean hasSelectableTemperatureResolution()
          Query to see if this device has selectable resolution.
 boolean hasTemperatureAlarms()
          Query to see if this temperature measuring device has high/low trip alarms.
 void setTemperatureAlarm(int alarmType, double alarmValue, byte[] state)
          This method sets the alarm value in degrees C in the provided state data.
 void setTemperatureResolution(double resolution, byte[] state)
          This method sets the current resolution in degrees C in the provided state data.
 
Methods inherited from interface com.dalsemi.onewire.container.OneWireSensor
readDevice, writeDevice
 

Field Detail

ALARM_HIGH

public static final int ALARM_HIGH
High alarm

ALARM_LOW

public static final int ALARM_LOW
Low Alarm
Method Detail

hasTemperatureAlarms

public boolean hasTemperatureAlarms()
Query to see if this temperature measuring device has high/low trip alarms.
Returns:
boolean, true if has high/low trip alarms

hasSelectableTemperatureResolution

public boolean hasSelectableTemperatureResolution()
Query to see if this device has selectable resolution.
Returns:
boolean, true if has selectable resolution

getTemperatureResolutions

public double[] getTemperatureResolutions()
Query to get an array of available resolutions in degrees C.
Returns:
double[], available of resolutions in degrees C

getTemperatureAlarmResolution

public double getTemperatureAlarmResolution()
                                     throws OneWireException
Query to get the high/low resolution in degrees C.
Returns:
double, high/low resolution resolution in C

getMaxTemperature

public double getMaxTemperature()
Query to get the maximum temperature in degrees C.
Returns:
double, maximum temperature in C

getMinTemperature

public double getMinTemperature()
Query to get the minimum temperature in degrees C.
Returns:
double, minimum temperature in C

doTemperatureConvert

public void doTemperatureConvert(byte[] state)
                          throws OneWireIOException,
                                 OneWireException
Perform an temperature conversion. Use this state information to calculate the conversion time.
Parameters:
state - - byte array of device state
Throws:
OneWireIOException -  
OneWireException -  

getTemperature

public double getTemperature(byte[] state)
                      throws OneWireIOException
This method extracts the Temperature Value in degrees C from the state data retrieved from the 'readDevice()' method.
Parameters:
state - - byte array of device state
Returns:
double, temperature in degrees C from the last 'doTemperature()'
Throws:
OneWireIOException - In the case of invalid temperature data

getTemperatureAlarm

public double getTemperatureAlarm(int alarmType,
                                  byte[] state)
                           throws OneWireException
This method extracts the specified Alarm value in degrees C from the state data retrieved from the 'readDevice()' method.
Parameters:
alarmType - - integer, indicating trip type ALARM_HIGH (1) or ALARM_LOW (0)
state - - byte array of device state
Returns:
double, alarm trip temperature in degrees C

getTemperatureResolution

public double getTemperatureResolution(byte[] state)
This method extracts the current resolution in degrees C from the state data retrieved from the 'readDevice()' method.
Parameters:
state - - byte array of device state
Returns:
double, temperature resolution in degrees C

setTemperatureAlarm

public void setTemperatureAlarm(int alarmType,
                                double alarmValue,
                                byte[] state)
                         throws OneWireException,
                                OneWireIOException
This method sets the alarm value in degrees C in the provided state data. Use the method 'writeDevice()' with this data to finalize the change to the device.
Parameters:
alarmType - - integer, indicating trip type ALARM_HIGH (1) or ALARM_LOW (0)
alarmValue - - double, high trip value in degrees C
state - - byte array of device state

setTemperatureResolution

public void setTemperatureResolution(double resolution,
                                     byte[] state)
                              throws OneWireException,
                                     OneWireIOException
This method sets the current resolution in degrees C in the provided state data. Use the method 'writeDevice()' with this data to finalize the change to the device.
Parameters:
resolution - - double, temperature resolution in degrees C
state - - byte array of device state