summaryrefslogtreecommitdiffstats
path: root/mainloop.hpp
Commit message (Collapse)AuthorAgeFilesLines
* Use hwmonio for attribute IOBrad Bishop2017-08-311-0/+3
| | | | | | | | | | Moves disparate error handling scenarios from the method doing the IO to the call point. Resolves openbmc/openbmc#2166 Change-Id: I3b6d2e175433dd8b2946ae60381901f2d7ca1798 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* mainloop: Cache devpath at startupBrad Bishop2017-08-311-0/+4
| | | | | | | | | | Currently the devpath is determined after a bus error to make a callout. Finding the path at startup is less prone to race conditions around ENOENT on driver unload in the event of a callout. Change-Id: I8ce8d9f630c8b7ecc398082002aa113ab352d3cb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Introduce interval configuration for sensor reads.Patrick Venture2017-06-051-0/+4
| | | | | | | | | | | | | | | | | This introduces the ability to specify in the sensor label configuration file, a specific sleep interval. The interval is in this file to allow straightforward interval control over the sensors listed in that file. Sensors grouped in the same file are treated as a group and run within the same instance. Tested: I tested setting the interval in one of four running configurations and the change was picked up in that configuration while the others ran at the default interval. Resolves openbmc/phosphor-hwmon#5 Change-Id: Ia9e474bc446090c8ac95dc2e6bf23a4fd6ccf7b7 Signed-off-by: Patrick Venture <venture@google.com>
* Minor path/string op tweaksBrad Bishop2017-02-281-2/+4
| | | | | | | | | | Store the hwmon instance and hwmon classpath root separately. Use string::assign(char) for where appropriate. Change-Id: I4ba756a262b9efee7a31610bf01c014974d27af3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add object info tupleBrad Bishop2017-01-171-1/+2
| | | | | | | | | The object path, bus connection, and sdbusplus interfaces are almost always needed together so use a tuple for passing these around. Change-Id: I784edae95f03d306633ccf94209faa381b91a596 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Create DBus objectsBrad Bishop2017-01-131-1/+6
| | | | | | | Create DBus objects for configured sensors. Change-Id: I26e0b9bc81ce8bf1798e7f67396ace1b954a2028 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add labelsBrad Bishop2017-01-131-1/+1
| | | | | | | | | | | | | | Labels are descriptive names for sensor channels. For example a label for temp1 might be "motherboard". Labels will be used as the final path element when creating DBus objects so they are bound by the same restrictions as DBus object paths. Discover labels from the environment when scanning sysfs. Ignore inputs that don't have a label. Change-Id: I2aa5684447f106d99361a9834eaad43d21037d5c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add sensor stateBrad Bishop2017-01-131-0/+6
| | | | | | | | Add another associative container of hwmon sensor instances that maps assorted data required to maintain the state of dbus objects. Change-Id: I12dc7eda88e49942d98216fd06557bba87c9431c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Grab DBus connectionBrad Bishop2017-01-131-1/+7
| | | | | | | | Connect to DBus and own a busname. Create a freedesktop ObjectManager. Change-Id: I186dadc5a5172f44edf9cfc8d0a338677636de04 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add config optionsBrad Bishop2017-01-131-1/+16
| | | | | | | | Obtain the DBus service name prefix and sensors namespace root path from the configure script. Change-Id: I5c48882b62b09a466b3b7b30b3935d65ccc58326 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add a shutdown option to main loopBrad Bishop2017-01-131-1/+37
| | | | | | | | | | A shutdown option allows another thread to shut the server down. Typically this is only done at the end of a testcase that runs the server in one thread, and then executes tests from another. Change-Id: I7658bba79285d7c3e41b578c3510faa3363c5e01 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove main loop from application fileBrad Bishop2017-01-121-0/+3
Isolate main in its own file for maximum flexibility when linking. Change-Id: I7b1f591386d69a7044c65e7aab2116626166e4ff Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud