     */
    void set_scale_unit(units new_scale_unit);

    /**
     * Set the priority for this sensor. This method adjusts, how
     * often the sensor is to be queried for a new measured value.
     * The last finite frequency of the inquiries arises as a result of the
     * priorities of all sensors. The priority gradates only the sensor
     * thereupon in, how quickly measured values could change.
     * @param new_priority The priority of this sensor. The bigger this value,
     * the rarer the inqueries.
     */
    void set_priority(int new_priority) const;

    /**
     * Get the measured data of this sensor
     * @return The measure data of this sensor, calculated at the selected
     * scale unit; ERROR_VALUE if the sensor isn't connected at the device or
     * if there's still no buffered data of this sensor, because it has been
     * just connected.
     */
    double get_measured_data() const;

  private:

    /**
     * Calculate the measure data from the digital data the serial sensor
     * device provides.
     * @param digital The digital interpretation of the measure data,
     * normally a value between 0 and 1023.
     * @return The measure value at the selected scale unit
     */
    double calc_measure_data(int digital) const;

    /**
     * The selected scale unit of the measure data
     */
    units scale_unit;

    /**
     * The selected priority of this sensor
     */
    mutable int priority;

    /**
     * The last valid value of this sensor
     */
    mutable std::pair<double,timeval> last_valid_value;
};

} // namespace sensor
} // namespace iwear

#endif /*TEMPERATURESENSOR_H*/


