HumidityContainer Interface Reference

Inherits com::dalsemi::onewire::container::OneWireSensor.

Inherited by OneWireContainer41.

List of all members.


Detailed Description

1-Wire Humidity interface class for basic Humidity measuring operations.

This class should be implemented for each Humidity type 1-Wire device.

The HumidityContainer methods can be organized into the following categories:

Usage

Example

Gets humidity reading from a HumidityContainer instance 'hc':

 
   double lastHumidity;

   // get the current resolution and other settings of the device (done only once)
   byte[] state = hc.readDevice();

   // loop to read the humidity
   do 
   {
      // perform a humidity conversion
      hc.doHumidityConvert(state);

      // read the result of the conversion
      state = hc.readDevice();

      // extract the result out of state
      lastHumidity = hc.getHumidity(state);
      ...

   }
   while (!done);
  

See also:
com.dalsemi.onewire.container.OneWireContainer28
Version:
0.00, 27 August 2001
Author:
DS

Public Member Functions

boolean isRelative ()
 Checks to see if humidity value given is a 'relative' humidity value.
boolean hasHumidityAlarms ()
 Checks to see if this Humidity measuring device has high/low trip alarms.
boolean hasSelectableHumidityResolution ()
 Checks to see if this device has selectable Humidity resolution.
double[] getHumidityResolutions ()
 Get an array of available Humidity resolutions in percent humidity (0 to 100).
double getHumidityAlarmResolution () throws OneWireException
 Gets the Humidity alarm resolution in percent.
void doHumidityConvert (byte[] state) throws OneWireIOException, OneWireException
 Performs a Humidity conversion.
double getHumidity (byte[] state)
 Gets the humidity expressed as a percent value (0.0 to 100.0) of humidity.
double getHumidityResolution (byte[] state)
 Gets the current Humidity resolution in percent from the state data retrieved from the readDevice() method.
double getHumidityAlarm (int alarmType, byte[] state) throws OneWireException
 Gets the specified Humidity alarm value in percent from the state data retrieved from the readDevice() method.
void setHumidityAlarm (int alarmType, double alarmValue, byte[] state) throws OneWireException
 Sets the Humidity alarm value in percent in the provided state data.
void setHumidityResolution (double resolution, byte[] state) throws OneWireException
 Sets the current Humidity resolution in percent in the provided state data.

Static Public Attributes

static final int ALARM_HIGH = 1
 high temperature alarm
static final int ALARM_LOW = 0
 low temperature alarm

Member Function Documentation

boolean isRelative (  ) 

Checks to see if humidity value given is a 'relative' humidity value.

Returns:
true if this HumidityContainer provides a relative humidity reading
See also:
getHumidityResolution

getHumidityResolutions

setHumidityResolution

Implemented in OneWireContainer41.

boolean hasHumidityAlarms (  ) 

Checks to see if this Humidity measuring device has high/low trip alarms.

Returns:
true if this HumidityContainer has high/low trip alarms
See also:
getHumidityAlarm

setHumidityAlarm

Implemented in OneWireContainer41.

boolean hasSelectableHumidityResolution (  ) 

Checks to see if this device has selectable Humidity resolution.

Returns:
true if this HumidityContainer has selectable Humidity resolution
See also:
getHumidityResolution

getHumidityResolutions

setHumidityResolution

Implemented in OneWireContainer41.

double [] getHumidityResolutions (  ) 

Get an array of available Humidity resolutions in percent humidity (0 to 100).

Returns:
byte array of available Humidity resolutions in percent with minimum resolution as the first element and maximum resolution as the last element.
See also:
hasSelectableHumidityResolution

getHumidityResolution

setHumidityResolution

Implemented in OneWireContainer41.

double getHumidityAlarmResolution (  )  throws OneWireException

Gets the Humidity alarm resolution in percent.

Returns:
Humidity alarm resolution in percent for this 1-wire device
Exceptions:
OneWireException Device does not support Humidity alarms
See also:
hasHumidityAlarms

getHumidityAlarm

setHumidityAlarm

Implemented in OneWireContainer41.

void doHumidityConvert ( byte[]  state  )  throws OneWireIOException, OneWireException

Performs a Humidity conversion.

Parameters:
state byte array with device state information
Exceptions:
OneWireIOException on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireException on a communication or setup error with the 1-Wire adapter

Implemented in OneWireContainer41.

double getHumidity ( byte[]  state  ) 

Gets the humidity expressed as a percent value (0.0 to 100.0) of humidity.

Parameters:
state byte array with device state information
Returns:
humidity expressed as a percent
See also:
hasSelectableHumidityResolution

getHumidityResolution

setHumidityResolution

Implemented in OneWireContainer41.

double getHumidityResolution ( byte[]  state  ) 

Gets the current Humidity resolution in percent from the state data retrieved from the readDevice() method.

Parameters:
state byte array with device state information
Returns:
Humidity resolution in percent for this 1-wire device
See also:
hasSelectableHumidityResolution

getHumidityResolutions

setHumidityResolution

Implemented in OneWireContainer41.

double getHumidityAlarm ( int  alarmType,
byte[]  state 
) throws OneWireException

Gets the specified Humidity alarm value in percent from the state data retrieved from the readDevice() method.

Parameters:
alarmType valid value: ALARM_HIGH or ALARM_LOW
state byte array with device state information
Returns:
Humidity alarm trip values in percent for this 1-wire device
Exceptions:
OneWireException Device does not support Humidity alarms
See also:
hasHumidityAlarms

setHumidityAlarm

Implemented in OneWireContainer41.

void setHumidityAlarm ( int  alarmType,
double  alarmValue,
byte[]  state 
) throws OneWireException

Sets the Humidity alarm value in percent in the provided state data.

Use the method writeDevice() with this data to finalize the change to the device.

Parameters:
alarmType valid value: ALARM_HIGH or ALARM_LOW
alarmValue alarm trip value in percent
state byte array with device state information
Exceptions:
OneWireException Device does not support Humidity alarms
See also:
hasHumidityAlarms

getHumidityAlarm

Implemented in OneWireContainer41.

void setHumidityResolution ( double  resolution,
byte[]  state 
) throws OneWireException

Sets the current Humidity resolution in percent in the provided state data.

Use the method writeDevice() with this data to finalize the change to the device.

Parameters:
resolution Humidity resolution in percent
state byte array with device state information
Exceptions:
OneWireException Device does not support selectable Humidity resolution
See also:
hasSelectableHumidityResolution

getHumidityResolution

getHumidityResolutions

Implemented in OneWireContainer41.


The documentation for this interface was generated from the following file:

Generated on Thu Aug 28 15:42:32 2008 for 1-Wire API for .NET by  doxygen 1.5.6