Interface HumidityContainer

All Superinterfaces:
OneWireSensor
All Known Implementing Classes:
OneWireContainer26, OneWireContainer41

public interface HumidityContainer extends OneWireSensor
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:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    high temperature alarm
    static final int
    low temperature alarm
  • Method Summary

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

    Methods inherited from interface com.dalsemi.onewire.container.OneWireSensor

    readDevice, writeDevice