summaryrefslogtreecommitdiffstats
path: root/sensors/builder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add Fan Redundancy SupportJames Feist2019-06-051-2/+17
| | | | | | | | | | | | | | This adds fan redundancy support to passive sensors. If there are redundancy interfaces on dbus, we'll fail a sensor if the status is set to failed. Tested: Set Redundancy to Failed On Dbus, saw all fans in collection boost. Then restarted swampd, came up and still boosted. Set redundancy OK, and they all slowed down. Change-Id: I8879bef1471bbc168435d6b22dd20006b9dca133 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Make dbusconfiguration reloadable without rebootJames Feist2019-05-091-2/+3
| | | | | | | | | | | | | | | | | Now that asio is being used instead of threads, we can reload the fan configuration without having to restart the application. This moves the ownership of the passive and host bus outside of the SensorManager so that it can be recreated each reload. Tested: Watched logs and saw full fan config get reloaded after changing fan configuration Tested: Ran on json configured system and it behaved as expected. Change-Id: I00e6b27f75384fd41de2017b723f159c9691ae97 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Expand conf namespaceJames Feist2019-02-261-2/+2
| | | | | | | | | Put rest of conf.hpp in the conf namespace. This is largely a sed replace, and wrapping from_json in conf namespace as it failed to build. Change-Id: I9fe5c7b2fface44618c43af2367035afc39bcb64 Signed-off-by: James Feist <james.feist@linux.intel.com>
* dbuspassive: allow scalingJames Feist2019-02-261-2/+2
| | | | | | | | | | | | | | | | 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>
* conf change: sensors: read and write path renamePatrick Venture2019-02-111-12/+12
| | | | | | | | Rename the readpath and writepath for camelcase styling to make all configuration variables consistent. Change-Id: I33f475075c8f40cd2029a5c0bfda950846cd5d44 Signed-off-by: Patrick Venture <venture@google.com>
* style: misc camel casingPatrick Venture2018-10-301-4/+4
| | | | | | | Miscellaneous camel casing. Change-Id: I90f7ab36448ad7c6a8e22677345d9d15591a64d5 Signed-off-by: Patrick Venture <venture@google.com>
* sensors: throw build time exceptions on failurePatrick Venture2018-10-301-3/+13
| | | | | | | Throw build time exceptions on failure. Change-Id: I7f873e15d0827b2424b9a1cfb6b494546952f1aa Signed-off-by: Patrick Venture <venture@google.com>
* errors: add exception for build time failurePatrick Venture2018-10-301-0/+1
| | | | | | | Add a specific exception for build-time failures. Change-Id: I1e6189ca256398d6995d4d0e0127846e1a7249a9 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: dbuswrite: use factory to catch errorsPatrick Venture2018-10-301-2/+4
| | | | | | | | Add factories for creating DbusWrite and DbusWritePercent objects and use these factories. Change-Id: Iad222d4bf6c1fdf561daa4ba9d88a6644c0a5965 Signed-off-by: Patrick Venture <venture@google.com>
* style: function names should be lower camelPatrick Venture2018-10-301-3/+3
| | | | | | | Fix function names to be lower camel. Change-Id: I145e1f4c03d7740bc1525dcffbdce2f78fd61075 Signed-off-by: Patrick Venture <venture@google.com>
* style: member functions should be lower camelPatrick Venture2018-10-301-2/+2
| | | | | | | Rename member functions to be lower camel instead of snake case. Change-Id: Ib227fd3dadb6d9607290277205223a4324cd4ce5 Signed-off-by: Patrick Venture <venture@google.com>
* style: fixup naming of structuresPatrick Venture2018-10-301-2/+3
| | | | | | | Fixup naming of structures to UpperCamel. Change-Id: I6a9bf0b954298089c85d3362e86cd95b3fc5b944 Signed-off-by: Patrick Venture <venture@google.com>
* cleanup: apply constness to read-only iteratorsPatrick Venture2018-10-231-1/+1
| | | | | | | Apply const to read-only iterators to indicate intent more clearly. Change-Id: Ic14304c69361da203d3d3a900180bd54346acc87 Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-08-311-38/+16
| | | | | Change-Id: I6627b5569c2e0f730be7331403218b823a2c622f Signed-off-by: Patrick Venture <venture@google.com>
* Add ability to configure from dbusJames Feist2018-07-231-0/+18
| | | | | | | | | | | | | | This allows configuration of PID control from dbus using entity manager. Sample configuration will be pushed to entity-manager repo shortly. Tested-by: Used yaml configuration and dbus / entity-manager based configuration and pid seemed to work the same. Verified printout of configuration matched generated cpp files. Change-Id: Ia7b016e53262791ffcccdb9b21c1ccddae2926bc Signed-off-by: James Feist <james.feist@linux.intel.com>
* test: dbus: passive read interfacePatrick Venture2018-06-281-5/+5
| | | | | | | | | | 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-1/+3
| | | | | | | | | | 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>
* enable unit-tests: enable for SensorManagerPatrick Venture2018-06-141-7/+9
| | | | | | | | | | | | | Enabled unit-tests in general for the project, and more specifically started with a benign construction test for the SensorManager object. Tested: Verified continues to build and link, and unit-test passes. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I4ad9a0c57efd0b9ccc37d26faa0cc1b82026b8d7 Signed-off-by: Patrick Venture <venture@google.com>
* sensors: split building from manager objectPatrick Venture2018-06-141-0/+153
To increase testability, split out the building of sensors from the sensor manager. And this further splits out building from a configuration file. Tested: Verified code continued to build and link. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: Ib63a11e1107b1864c3c370bba2bd9ef2effa42f3 Signed-off-by: Patrick Venture <venture@google.com>
OpenPOWER on IntegriCloud