summaryrefslogtreecommitdiffstats
path: root/dbus/util.cpp
Commit message (Collapse)AuthorAgeFilesLines
* util: Avoid division by invalid valueKun Yi2019-07-101-1/+1
| | | | | | | Check for max > min before dividing by difference Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: Ic2a983bb6f7c04f1deafcab228b76ff60012f011
* Consolidate all util.hppJames Feist2019-05-081-2/+2
| | | | | | | | This deletes all lower level util.hpp and cats them into the top level util.hpp to avoid name conflicts. Change-Id: Ia11e4a08053a3970b0aadf21d1156ab26def36bd Signed-off-by: James Feist <james.feist@linux.intel.com>
* dbuspassive: allow scalingJames Feist2019-02-261-2/+21
| | | | | | | | | | | | | | | | For tachs it is beneficial to deal in percent so that multiple controllers can be used with different fan types without having to recalculate. This starts using the unused min and max fields to be able to scale readings. Since max and min are commonly on the value interface, the special value of <int64_t>::lowest() allows these to be gathered from dbus instead of having to enter them manually. Tested-by: Moved pid control to percent and printed outputs Change-Id: I9496eb92a18b68a7cd7f034d41d40ef5175c6974 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Move all variant usage to stdJames Feist2019-02-081-11/+7
| | | | | | | | | | This just a style change, remove variant_ns in favor of std. Tested-by: it built Change-Id: Id5a075e8b73a7724cbc5153fb7dfcf369e79c483 Signed-off-by: James Feist <james.feist@linux.intel.com>
* std::variant: Fixup apply_visitor callsWilliam A. Kennington III2018-11-121-1/+1
| | | | | | | | These should be std::visit compatible instead of the custom mapbox apply_visitor. Change-Id: I32098c02bda5a3699abace919426a6e4b9c8ae9c Signed-off-by: William A. Kennington III <wak@google.com>
* cleanup: drop obsolete is_method_error checksPatrick Venture2018-10-311-4/+1
| | | | | | | is_method_error is obsolete from sdbusplus. Change-Id: Ia3fb76dd2f4a14eca51b3cfbcd50427b36d946b3 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: util: add missing try/catch blockPatrick Venture2018-10-301-6/+11
| | | | | | | Add missing try/catch block to getProperties. Change-Id: Ie1f08f496dc529432df620879416e8bddb2e7d5c Signed-off-by: Patrick Venture <venture@google.com>
* style: function names should be lower camelPatrick Venture2018-10-301-4/+4
| | | | | | | Fix function names to be lower camel. Change-Id: I145e1f4c03d7740bc1525dcffbdce2f78fd61075 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: util: add missing try/catch blockPatrick Venture2018-10-301-6/+15
| | | | | | | Add try/catch block around ObjectMapper call failures. Change-Id: I5a2a7a8c1049ea16cebe8b87a509bf5104e432ab Signed-off-by: Patrick Venture <venture@google.com>
* style: member functions should be lower camelPatrick Venture2018-10-301-3/+3
| | | | | | | Rename member functions to be lower camel instead of snake case. Change-Id: Ib227fd3dadb6d9607290277205223a4324cd4ce5 Signed-off-by: Patrick Venture <venture@google.com>
* [dbus-passive] Add threshold fan failureJames Feist2018-10-151-1/+46
| | | | | | | | | | | | | | When a threshold is crossed for a monitored sensor, assert fan failure. Tested-by: Changed a sensor threshold so that its current reading made the threshold asserted and noticed via print messages that the sensor went into failure state. Also noticed fans ramp. Wrote unit test to verify sensor can move in and out of error state correctly. Change-Id: I83182536e4874eaba97f3f1d48d53ac110fba833 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Stop using mapbox namespace directlyJames Feist2018-10-111-2/+2
| | | | | | | | | | | sdbusplus is transitioning to std::variant, the sdbusplus::message::variant_ns will be changed to std and should move over correctly, but mapbox will be deleted. Tested-by: It built Change-Id: I25672cef16a6c75ae2f3619d319ade1eb063a98b Signed-off-by: James Feist <james.feist@linux.intel.com>
* add .clang-formatPatrick Venture2018-08-311-12/+10
| | | | | Change-Id: I6627b5569c2e0f730be7331403218b823a2c622f Signed-off-by: Patrick Venture <venture@google.com>
* Add double support for sensor interfaceJames Feist2018-08-101-7/+20
| | | | | | | | | Add support for reading sensors that produce a double as the value. Use a visitor to pull out the sensor value so type doesn't matter. Change-Id: I37c05e7077ead6f3084ab9704a1b2c62becb5e19 Signed-off-by: James Feist <james.feist@linux.intel.com>
* test: dbus: passive read interfacePatrick Venture2018-06-281-0/+6
| | | | | | | | | | Added basic unit-tests and added a factory for creating the DbusPassive read interface so that it can be nicely error checked. This is handled via a valid type check where the only valid types are 'fan' and 'temp'. Change-Id: I558ed09bf509d26f20c6e431bb0789074e9aa841 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: transition to interface for testingPatrick Venture2018-06-221-11/+13
| | | | | | | | | | To make testing easier, the dbus objects now receive a helper interface to use instead of calling into a helper module. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I2521d9c75aec76e92d2e26dc044d01011e44d552 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: util: Remove explicit element countPatrick Venture2018-05-101-5/+1
| | | | | | | | | | The dbus interface can have new properties added, and it's improbable to have the three we care about removed. Therefore, let's remove the explicit count check on the number of properties returned. Change-Id: Ia292c73dc889a33a4b1f334585bbce910f20a580 Signed-off-by: Patrick Venture <venture@google.com>
* Sensor ObjectsPatrick Venture2018-03-081-0/+109
This includes all the sensor objects including a few implementations, including dbus and sysfs sensors. Change-Id: I9897c79f9fd463f00f0e02aeb6c32ffa89635dbe Signed-off-by: Patrick Venture <venture@google.com>
OpenPOWER on IntegriCloud