| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
_enable nodes
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Use that function instead of making a relative path manually.
Change-Id: I64908353295a10af09baa91bab5d1c3a0152e994
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
| |
Installs into bin instead of sbin per guidelines.
Change-Id: I298c17fb2bf6fcb6a949624f8bb2475f3878545f
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Enable valgrind to check memory usage.
Change-Id: I73ec2ee1a92e797ea9b78d6ea440f9ccdd2f49f3
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Flip the error and help message on failure.
Change-Id: Ib75d6df87a37411edd7283fdf7785e8d56e417ea
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
Swap out getopt for cli11 for parsing parameters.
Tested: Verified on quanta-q71l-variant that phosphor-hwmon started as
before.
Change-Id: Ic0137432afd254b77133842b5d73a5bab1e415aa
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
Enable code coverage for the project. Valgrind not enabled in this
step.
Tested: Verified code coverage step now running.
Change-Id: Ieb3606e5ad741fb0dd181f8da594c18258efa6bc
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike std::experimental::filesystem::path, with
std::filesystem::path, the /= operator will turn an append
of an absolute path (starts with a '/') into a '='.
So, ensure the paths aren't absolute.
Change-Id: Ie8fb9d056042e277415e8ea0eb29d094a2665611
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Use filesystem now that it should be available instead of
experimental::filesystem.
Change-Id: I62838b343ce34f85a47661f1eaaff3c7e6338bbf
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Rework the gtest/gmock lookup based on openbmc/gpioplus.
Change-Id: Ic53928e6f8b7a30e801976d62c910fe31bd4cc49
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Use Pair-wise comparison instead of straight equality check.
Change-Id: I3aa567015bfbd81578275fc0edf1ef785fde7678
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Cleanup the .gitignore file, and add some new pieces for code coverage.
Change-Id: I26c961956b07b51018c7edc50459bf2fe09541fc
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Use the defaults in the pkg check where the default error message is
sufficient to identify which package is missing.
Change-Id: Iad7753b8e6a80307ad57a9a6dd2d442ec7fe0e67
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Add a test that calls adjust value on a sensor value to verify it's
processed as expected.
Change-Id: Iff299efced680c730d7ba5bdeff71617446db042
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
The _scale member will not be used without ::addValue() being called
first, however, initialize it regardless to 0.
Change-Id: I712e9192500a8a58db03bcbbaf0f0d736f1dfd23
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
Cleanup the configure script package include lines. There isn't a set
style for this yet, but this is an attempt to improve readability
whereas it's often one long line per library.
Change-Id: I9df8c9384b54bba30bb49193ee2dd6e532f99249
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add a sensor constructor test where the gpio handle is required.
Change-Id: I05050fb71a6287183ca94f974e965e3f58de9499
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add underscore prefix to members for sensor object.
Change-Id: I5b59f9f45cc20bd700940bc3b0e5d2d4127b333d
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add gpio handle mock implementation for use in testing.
Change-Id: I0fb2d1af4739ad700f62a4e7cbbe62db528bb93e
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add a variety of tests for different sensor constructor scenarios.
Change-Id: I859a9473e3c80fb06b0ae15f0eeb8217ee390b11
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add environment mock implementation for use in testing.
Change-Id: I5a8efe994692a2e4436bf7f3c0155516d92b49c6
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add underscore prefix to members for SensorSet object.
Change-Id: Ibd6d5f2d18f3a730d847d09ffead3b752ef7dd4c
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add underscore prefix to members for fan_speed object.
Change-Id: I9a3c444fe31ffc4f15e15eefc15dc652d3b209f1
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add underscore prefix to members for fan_pwm object.
Change-Id: Ic90d20b6e3881e8b7efe08fde3a08607d7bc6a38
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add underscore prefix to members for hwmonio object.
Change-Id: Iab5aed5ddba3b1793bb16b0f1501a11ff95b7f35
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
| |
Most members of mainloop object have an underscore prefix. For
consistency add this prefix to all members. The discussion within
OpenBMC pertaining to prefixes and suffixes for member variables
indicates there is latitude within a repository.
Change-Id: Ifce915923b9b8c58a433f334d45e19143b7b734f
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
The sensor objects all share a reference to the mainloop's ioAccess
object. To enable testing, the sensor object needs to expect the base
pointer to this object.
Change-Id: I1d7f2841528776c8d4f1166e20874ddeb4b8554a
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Drop an extra check for a specific sdbusplus header file after checking
for the library.
Change-Id: If20864a1998434ae9de0689e324ddf7c6406777d
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
We are currently relying on sdbusplus implicitly including cassert for
us. Since we use assert(), depend on the header providing it.
Change-Id: Idb771e74d5c0d5bdb0d82455dfd9d2e1a8b6b6ef
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
| |
Add const to read-only iterators.
Change-Id: I848ec6a9558781fc193e19efa63494ec0cea3f46
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Lets use the new standard event loop timer utility that comes with
sdeventplus instead of the one copied from other projects.
Change-Id: Ie7c8f462f2c0e2e05ce14da58b30a1f91acbf75d
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Deduce type based on interface using decltype
and if it is double apply scale to the value.
Tested-by: Noticed that on dbus using busctl and debug
server that doubles were produced and scaled.
Also verifed that hwmon still produced int64_t values when
building with current phosphor-dbus-interfaces.
Change-Id: I00e21d5ef0ea6cee0eb30baa0b39cde95e7f4a86
Signed-off-by: James Feist <james.feist@linux.intel.com>
|
|
|
|
|
|
|
| |
Convert to using sdeventplus instead of sd_event directly.
Change-Id: Ie8ee25c2d75ac4c56b88fb79f70eaa53c4f7b6e4
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
We are now using c++17 so we no longer need experimental optional and
any. We can use the standard any and optional now.
Change-Id: I88fcb4258c69ac5ad9766e2c65463c52a3b7f05f
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
[sysfs.cpp:228]: (style) Consider using std::find_if algorithm instead of a
raw loop.
Change-Id: Ie07ca5e32405fc7d27e85936377cec44291d3f94
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Cppcheck CI tool identified many variables whose scope could be reduced.
Change-Id: I1478b5680adc560d08bc74ffc91929b1d19e24fa
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A GPIO can control whether a hwmon sensor is readable. This module
allows one to specify whether a sensor is gated and by what GPIO. This
is often the case for battery voltages, such that the battery isn't
drained constantly by being left open.
For each sensor where you need GPIO locking:
GPIOCHIP_in1=0
GPIO_in1=53
such that GPIOCHIP is the gpiochip: /sys/bus/gpio/devices/gpiochip{id}
such that GPIO is the line offset.
the value used to unlock the sensor via gpio is 1
after 1 is written to the gpio, it pauses for 500ms
Tested: Verified the failure case for invalid gpio fields. Verified
correct behavior on two platforms.
Change-Id: I2fa12848972075cad0e0f69c0bfa6382e15d4f50
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Added an ignore line for the unit-test generated output.
Change-Id: Ib6c2d1e6b01a67b9c4cbdfd35c421a4ab5c6f632
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Set configure.ac to attempt to build with c++17.
Change-Id: Ie09177e5de43bb1789befbb32678b802c1959bd2
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
| |
Change-Id: I562aad32f8b860fc954773428e6a929759c694d3
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
| |
Change-Id: Ia1b19aeba59b2f680b62ce3855e929b9ad77377a
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Using clang-format off/on instead of INDENT-OFF/ON.
Change-Id: If4ecec970cfc456f8461c42e03159df29b4e8542
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
| |
Change-Id: I94ce26d595367e08d6fb3734535bcd855f1b1473
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Failure scenraio:
set fan pwm => set fan auto => set fan pwm to the same value.
DBus value would stay the same but the actual pwm value is already
changed. Fix is to always commit the value to sysfs.
Tested:
Unit tests pass. Tested on hardware that setting DBus value on DBus
always makes a pwm sysfs write.
Change-Id: I8e2c22dd514543e10c9302c1adb0403ba6883a91
Signed-off-by: Kun Yi <kunyi731@gmail.com>
|
|
|
|
|
|
|
|
| |
Update configure.ac and test/Makefile.am to properly handle
newer googletest, per gerrit/11203.
Change-Id: I13563216784389d0a32f802daf23d75658e0288e
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
| |
Change-Id: Ie484a7add85bef4098571432c9b760245cbee8b8
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|