summaryrefslogtreecommitdiffstats
path: root/presence
Commit message (Collapse)AuthorAgeFilesLines
* Switch sd_event loops to sdeventplusWilliam A. Kennington III2018-10-294-25/+20
| | | | | | | | | This change is mostly focused around plumbing the sdeventplus::Event object everywhere and using the member functions provided for the event. No migration to the timer utility is performed yet. Change-Id: I912ab82bc081239d3b7c3cf7c5caca6742ef9c87 Signed-off-by: William A. Kennington III <wak@google.com>
* Add -flto to CXXFLAGSAndrew Geissler2018-08-271-1/+2
| | | | | | | | | | Per openbmc/openbmc#3364, adding -flto to CXX flags in order to reduce overall library and binary sizes. Ref: https://gcc.gnu.org/wiki/LinkTimeOptimization Change-Id: I3ee31a15fc0ded4308aa9d00a11b41bc62eb9799 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Use s.c_str() in log messagesJoseph Reynolds2018-05-301-2/+2
| | | | | | | | | Partly resolves openbmc/openbmc 2905 Tested: static_assert only Change-Id: I0cabc8d84c763af924d067880417c9a11bcfde58 Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
* Presence: Fix a log metadata entryMatt Spinler2018-05-091-1/+1
| | | | | Change-Id: I2d7b154de98bef1cb518d036496828c57a391144 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Spelling fixesGunnar Mills2017-10-251-2/+2
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Iefb2ad70d313a4800cd413c7c2e5e2154bec49fb Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* presence: Un-hardcode input device pathBrad Bishop2017-08-025-4/+12
| | | | | | | Allow a device path to be configured. Change-Id: I2eabd71747b124eae96738d1332f58b96ece6dc9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Allow missing tach sensorsBrad Bishop2017-08-021-4/+19
| | | | | | | | Do not allow missing tach sensors to abort the program. Instead, assume the fan is not spinning. Change-Id: Idc923b9c57b4d180aa16f0aa4933c65e7e4a2d42 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add parser support for any ofBrad Bishop2017-08-024-2/+46
| | | | | | | Add support for the anyof yaml keyword. Change-Id: Ib28ca8ef9959cec29cb2d15a0bf758668375895f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add any of redundancy policyBrad Bishop2017-08-023-0/+154
| | | | | | | | Add a bitwise logical or redundancy policy implementation (fan is present if any sensor indicates as such). Change-Id: I1d161478a4a6fe9d5690a385703e41c6fff9c81c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add sensor to redundancy policy apiBrad Bishop2017-08-025-5/+9
| | | | | | | | | | Include a reference to the sensor changing state when sensor implementations ping the policy object. This allows policy logic based on multiple sensors, simultaneously. Change-Id: I44cf00c7ecd220d0cc99e51ca6093bac6da7343c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add sensor comparisonBrad Bishop2017-08-023-1/+48
| | | | | | | Add a basic comparison operator for presence sensors. Change-Id: Ib147fd24f6e9ea1daf5f2b0b71943e0b4c96a8b7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add fallback testcaseBrad Bishop2017-08-022-0/+249
| | | | | Change-Id: Ic3390ba18d6f029fc16aee7492d51ac5f49bf2c0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add test directoryBrad Bishop2017-08-021-0/+7
| | | | | Change-Id: I1d0a8e7d4c442beb271c83d5ef6be3ca69c7c115 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Switch to new frameworkBrad Bishop2017-08-0211-588/+11
| | | | | | | | | Switch the main application logic to the output produced by the new parser previously. Remove unused code. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: If8b262bd80fd0f0135aeea55e578fb3c7f44339a
* presence: Invoke pfpgen.pyBrad Bishop2017-08-023-1/+8
| | | | | | | Invoke the new parser during build. Change-Id: I3a3c8c227a79e6f80a051c5e1d3a9a2b7f4e9656 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: New parserBrad Bishop2017-08-026-0/+533
| | | | | | | | | | | Adopt an easy on the tongue acronym similar to other projects. Add a robust parser with support for sensors and policies. Sensors: gpio, tach Policies: fallback Add an example yaml file. Change-Id: I9158a0ce2a08ef6b7bb3f5d659ea0e0433af5b96 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add fallback redundancy policyBrad Bishop2017-08-023-0/+181
| | | | | | | | | | | | Add a fallback redundancy implementation of the RedundancyPolicy interface. The fallback policy associates multiple PresenceSensor instances to a single fan, and "falls-back" on secondary sensor implementations when the primary sensor cannot see the fan. Change-Id: I6468d77d97b8916b3ff33bcd0cd28a102d1aaba1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add gpio presence sensorBrad Bishop2017-08-023-0/+206
| | | | | | | | | | | | Add a gpio presence implementation of the PresenceSensor interface. The gpio sensor simply maps the on off state of a gpio directly to the xyz.openbmc_project.Inventory.Item Present property. Change-Id: I071dd475bebb15372edb59506352746c20542eff Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add new tach sensor implementationBrad Bishop2017-08-023-0/+259
| | | | | | | | | | | | | Add a new fan speed (tach) presence implementation for the new PresenceSensor interface. This fan tach sensor behaves mostly like the existing one, with the addition of support for multiple tach sensors for the single PresenceSensor instance, and implementation of the PresenceSensor start and stop interfaces. Change-Id: I535a3e2c78ef0f06f10b6f4cda9a7e2d0e9c11db Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add redundancy policy interfaceBrad Bishop2017-08-021-0/+110
| | | | | | | | | | | | Add a redundancy policy interface class. Redundancy policies introduce the concept of multiple presence sensors for a given fan. A redundancy model implementation determines how the distinct sensors making up the redundancy set are controlled and how their feedbacks determine the overall fan presence state reflected in the inventory. Change-Id: Ibb5f71b3189dbb253bb669691e8016cda83a6ebb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add presence sensor interfaceBrad Bishop2017-08-021-0/+77
| | | | | | | | | | | | Prepare to extend the fan presence model to include sensors of other types with a presence sensor interface class. Presence sensors can be both event driven or polled. Provide start and stop for the former and present for the latter. Change-Id: Ia1b91a5e30e27fbe66c6f075e5e5ce620dac997e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Add fan utilityBrad Bishop2017-08-023-0/+110
| | | | | | | | Add utility wrappers for reading/writing xyz.openbmc_project.Inventory.Item.Present. Change-Id: I9d6bb776e56b67b9cac1f991790886ec8105d4b1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* evdevpp: Add C++ bindings for libevdevBrad Bishop2017-08-021-2/+4
| | | | | Change-Id: Iff27168588ee0767902801e6df3c6745a643ac9a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* presence: Check DBus for initial stateBrad Bishop2017-07-081-5/+38
| | | | | | | | At startup load the initial state from the DBus object if one exists already. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Ia4ad2f3c2b5c521406d9a186113b11cf8ed69b14
* presence: Add initialstate ctor argumentsBrad Bishop2017-07-083-9/+14
| | | | | | | | Allow class users to set the initial state of enclosures and tach sensors. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: If5199361ab051ca46096f66ba925aeb1a874801f
* presence: Remove work from enclosure constructorBrad Bishop2017-07-082-2/+2
| | | | | | | | Allow class users to control when an enclosure should export its state on DBus. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I64bc2d85b7a072e9ec539330640f766961724b17
* presence: Use new sdbusplus wrapperBrad Bishop2017-07-084-42/+19
| | | | | | | Use the sdbusplus wrapper methods introduced previously. Change-Id: Ifd431753e9513436a9b5ab98cc49d907a5929c20 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* phosphor-fan-presence elog error exception.Dinesh Chinari2017-06-282-11/+5
| | | | | | | | Implemented elog exception for phosphor fan presence, replacing runtime_errors. Change-Id: I70465060838b2cbaeadccf84ed5924e222ac59e3 Signed-off-by: Dinesh Chinari <chinari@us.ibm.com>
* Update to use match methods for signal callbacksMatthew Barth2017-06-262-46/+20
| | | | | | | | | | | Attach the tach change handler function to the match along with using the new match methods on the match string. Add 'argN' sensor value interface to reduce dbus traffic Resolves openbmc/phosphor-fan-presence#5 Change-Id: I9c809e42a384ea751d2f3a51b14ad304ce61cd2c Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* presence: build: Add yaml file to generated depsBrad Bishop2017-06-132-16/+3
| | | | | | | | Makefile updates such that updates to the YAML file result in a retrigger of the python script. Change-Id: I83b637f71dc380a56be0fd40390176d3b201b29a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fan control: Add getService() utility functionMatt Spinler2017-04-261-1/+1
| | | | | | | | | | | This function returns the service name from the mapper based on the dbus path and interface passed in. Eventually, getInvService can be removed and this call can be used instead. Change-Id: Ieb090a9b650803e8cfaf2f24143f25a4bbf1cd23 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* build: Move presence to a subdirectoryBrad Bishop2017-04-2411-0/+664
Change-Id: I33b28922107b9b041de3699e4a6eebd3d05ebdef Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud