commit | 7ab1b25b50bd4f68062c6a07200f8f69f09d3387 | [log] [tgz] |
---|---|---|
author | Matt Spinler <spinler@us.ibm.com> | Wed Jul 22 15:11:02 2020 -0500 |
committer | Matt Spinler <spinler@us.ibm.com> | Wed Jul 22 15:29:41 2020 -0500 |
tree | 0a4365568634e44c7def37d421c4d34497ac4047 | |
parent | 6a391de429f7f3ef54aca821be0d70acee6b84a7 [diff] |
Fix applying sensor scale on first read In Sensor::addValue(), the adjustValue() function was being called before the _scale member was getting set. So until the first interval timer expired the sensor value would be unscaled. For example it could show a temperature of 27000.0 instead of 27.0. To fix this, reorder the code so that first _scale would get set, then the sensor value would get adjusted based on _scale, and finally the value could be set on the Value interface. Tested: Use a big INTERVAL config value so that I can check the first read of a sensor does leave it unscaled. Then test with fix and check that it is correct. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id0e2c71961f343246a42ba4c546e806350040e01
Exposes generic hwmon entries as DBus objects. More information can be found at Sensor Architecture
To build this package, do the following steps: 1. ./bootstrap.sh 2. ./configure ${CONFIGURE_FLAGS} 3. make To clean the repository run `./bootstrap.sh clean`.
To enable the use of Linux features like cgroups prioritization and udev/systemd control, one instance of phosphor-hwmon is intended to be run per hwmon sysfs class instance. This requires an algorithm for selecting a stable, well-known D-Bus busname. The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default), ID is a std::hash of the /sys/devices path backing the hwmon class instance, and N is the implemented phosphor-hwmon D-Bus API version.