summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Removed unused directory moduleBrad Bishop2017-03-082-77/+0
| | | | | Change-Id: I056631388bc71ee0d90be94f4424438ba627788b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Use std::filesystem in favor of custom moduleBrad Bishop2017-03-084-23/+17
| | | | | | | | | Reuse some code. Fix a bug in the process. Resolves openbmc/openbmc#1254 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I3fdbb70d6372f4a3193204bd2c9b6535315a3c70
* Build: Autotools usage improvementsBrad Bishop2017-03-083-9/+15
| | | | | | | | | | | Use libtool defaults. Define CXXFLAGS rather than CFLAGS. Add libraries via LIBADD rather than LDFLAGS. This allows --as-needed to drop unnecessary libs if present. Don't bother with PIC objects for convenience library. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I4a6079402a01ad5f6ccfb71ca9fca44c567ec62d
* Replace readdir_r with readdir since readdir_r was deprecatedSaqib Khan2017-03-031-11/+2
| | | | | | | | The updated yocto version doesn't support the recently deprecated readdir_r. Therefore replacing it with readdir Change-Id: Ib7ad8b662023f3b4736886a33c012f6147e4a288 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Remove unused methodsBrad Bishop2017-03-011-14/+0
| | | | | Change-Id: Ifcc8023f6e33c53e484497d6f90f4b117cf59072 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Log failing path after sysfs access failuresBrad Bishop2017-03-015-20/+84
| | | | | | | | Log failing device path and error after a sysfs access failure. Gracefully exit rather than crash. Change-Id: I41316e84a70ceda8c166f31ab3269f97978da3ab Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Minor path/string op tweaksBrad Bishop2017-02-282-15/+28
| | | | | | | | | | 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>
* Per design direction, all dbus object paths should be lower case.Leonel Gonzalez2017-02-231-1/+1
| | | | | Change-Id: I7b31a2c5bae56a51294c21d8942f69354d92f0cb Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* Link to libphosphor_dbusBrad Bishop2017-02-169-1422/+10
| | | | | | | Remove manually generated server bindings. Change-Id: I77ccda7f669d58f55e86ee5887dbbb380c673390 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Delay emission of InterfacesAddedBrad Bishop2017-01-302-2/+10
| | | | | | | | | Make use of sdbusplus::server::object::object defered signal emission feature so that only one InterfacesAdded signal is emitted when creating objects. Change-Id: I3f1668f8ea0565c7da74f750b0d4da677099924e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix out of tree build header search pathBrad Bishop2017-01-181-3/+3
| | | | | | | | | Until interface headers are installed in the sysroot, iquote must be used to get correct header search paths when building out of tree. Change-Id: I4a357cc173a793ac9026e737869604477cdf193b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix sdbusplus::server::object template wrapperBrad Bishop2017-01-171-2/+2
| | | | | | | The aliased template is vararg, so make the alias vararg as well. Change-Id: Ib562c09f625439c4b5f1234047dfc9378043cfb9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* sysfs: Remove return of const stringBrad Bishop2017-01-171-4/+4
| | | | | | | This prevents move operations. Change-Id: I897e7d5e7f72076144a1a1bc15abac9f76da3aee Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Test: Remove unnecessary server_thread methodBrad Bishop2017-01-171-10/+6
| | | | | | | | | std::thread allows any callback signature so remove the usual pthread void * foo(void *) wrapper when starting the server thread. Change-Id: I3b9e705da97258933a0c6b294c2c3bbdb8f98a27 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Avoid unnecessary move operationBrad Bishop2017-01-171-4/+4
| | | | | Change-Id: I7fcdbb653b36cfd1bb2566bf59861867d368c9df Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Instantiate objects in the correct namespaceBrad Bishop2017-01-171-7/+24
| | | | | | | | | | | | Add an hwmon -> dbus namespace map for sensor objects. For example, the OpenBMC DBus specification mandates that temperature sensors be instantiated in the temperature namespace. Prior to this patch they were simply instantiated in the temp namespace ( the hwmon sensor type ). Change-Id: I29c1982cc6b60e818cbc52458009aa6765c1111f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Detect power current and energy sensorsBrad Bishop2017-01-173-1/+20
| | | | | Change-Id: I058eb1f3093a583ef21dd4be01d3fa535131fbde Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add helper function for finding attributesBrad Bishop2017-01-171-13/+29
| | | | | | | | | This method cuts down on typing when searching for sensor type attributes. Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I639713c2c0ad4f00954ccdda8de6cb6ad919db03
* Update server bindingsBrad Bishop2017-01-172-0/+6
| | | | | | | Re-run sdbus++ to pick up the new units for energy, power and current. Change-Id: Ia772a65a55d5665494c676462f84ef761930cdd4 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Enable sensor thresholdsBrad Bishop2017-01-171-5/+25
| | | | | | | | Create the threshold interfaces at startup and check for exceeded bounds on each poll. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I5a567813a1821071b99af67c0aa6f24abc56bf2d
* Add threshold support methodsBrad Bishop2017-01-171-0/+117
| | | | | | | Add type traits and methods in support of sensor thresholds. Change-Id: I92a0c17aba4899c0d48bf76039d48a6ed1ee7f95 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add threshold typename aliasesBrad Bishop2017-01-171-0/+10
| | | | | Change-Id: I38b1891cd34249efef224264022f78f4159048d1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Move value interface creation to a helper method.Brad Bishop2017-01-171-28/+40
| | | | | Change-Id: Id383f18e681a30f41976c07be1c7c9929af6abb5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add configuration discovery helper methodBrad Bishop2017-01-174-10/+51
| | | | | | | | Sensor configuration is passed to the application via the enviroment. Create a map of environment values for a given sensor. Change-Id: I8369eda27798fd9472166e898b8d6166c6997392 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add object info tupleBrad Bishop2017-01-172-5/+8
| | | | | | | | | 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>
* Add Sensor.Threshold server bindingsBrad Bishop2017-01-175-1/+967
| | | | | | | | Temporarily add the server bindings for xyz.openbmc_project.Sensor.Threshold until they are available elsewhere. Change-Id: I476d0ee3abbc5a93a6720eedc4ecfa8ae0cc3d0c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add cmdline --of-name optionBrad Bishop2017-01-172-3/+16
| | | | | | | | Add an option for passing hwmon instances via the open firmware device path. This allows udev triggers based on the path. Change-Id: Icffc9734208204a052dc2910500df88136590e7d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Find hwmon instances from OF device pathsBrad Bishop2017-01-173-0/+68
| | | | | | | | Provide a method that scans the hwmon subtree for a matching open firmware device path. Change-Id: Ic71dea90113c6894d9d2b61e03bd02f6b550e1e6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add util.hppBrad Bishop2017-01-172-9/+25
| | | | | | | First utility is a malloc deleter for use with smart pointers. Change-Id: I78d1723608048cc64d81891d5aa6791eaf3343e5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Ignore . and .. when scanning directoriesBrad Bishop2017-01-171-0/+6
| | | | | Change-Id: Id015a5e6addf08674a362473a792170b11b55cb7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove use of std::endlBrad Bishop2017-01-171-5/+5
| | | | | | | isocpp/CppCoreGuidelines#357 Change-Id: Iebfb13e4e03859e66811b6a6c9a3fe9d1b8f85a5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove sensorcache.hppBrad Bishop2017-01-172-39/+0
| | | | | | | No longer used. Change-Id: I4c97e0fcd8edf34b122876000802afe26876e569 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Poll and update sensorsBrad Bishop2017-01-171-0/+10
| | | | | | | | Poll sensors between dbus traffic, and update dbus objects with polled values. Change-Id: I87d392e4eadcc80327cdc5f6de3a6f94a1e88283 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Set Sensors.Value unit and scale propertiesBrad Bishop2017-01-171-0/+49
| | | | | Change-Id: Ia916c0bb808e9fb37826c5ffa46ff6c8111a443d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add string literals for hwmon types and entriesBrad Bishop2017-01-131-7/+12
| | | | | | | Enable participation in constexpr. Change-Id: I182adcf866909e3d7d44b0e4cadedda362f4ad50 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Set sensor initial value.Brad Bishop2017-01-131-0/+10
| | | | | | | | Set the initial value of the value property in the Sensor.Value interface. Change-Id: I1324d3172d1f69cf90f59a065327ab8f739243ed Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* inline make_sysfs_pathBrad Bishop2017-01-131-4/+4
| | | | | | | Prevent multiple definitions. Change-Id: Ic394ced72f6eb2b21800b39be772dc4f9f0e8b2d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Create DBus objectsBrad Bishop2017-01-133-3/+26
| | | | | | | Create DBus objects for configured sensors. Change-Id: I26e0b9bc81ce8bf1798e7f67396ace1b954a2028 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add server binding typename aliasesBrad Bishop2017-01-132-0/+13
| | | | | | | | | Add a new header interfaces.hpp with some aliases. A new header is warranted given plans to implement additional interfaces that will require default sdbusplus binding overrides. Change-Id: Id30e84b0cc6df2f857735794937de57b6559d7e1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add labelsBrad Bishop2017-01-132-2/+19
| | | | | | | | | | | | | | 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>
* Move polling loop to state containerBrad Bishop2017-01-131-2/+9
| | | | | | | | Base the polling loop on the state instance, rather than SensorSet. Change-Id: I104c730f1ad07b0680d87902e2ed39e5afa5e9d2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add sensor stateBrad Bishop2017-01-132-1/+8
| | | | | | | | 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>
* Provide additional SensorSet type aliasesBrad Bishop2017-01-131-0/+2
| | | | | Change-Id: I543bd4a47d3bd75dc89a73026d23d3663e429bb9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Ignore labelsBrad Bishop2017-01-132-0/+7
| | | | | | | | Add a label literal. Ignore labels when scanning sysfs. Change-Id: Iab1946cc53bb5b32d9853cdca6c9b8e5ee5532e3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Explicitly define SensorSet constructorsBrad Bishop2017-01-131-1/+7
| | | | | | | | Declare all the default constructors. Add explicit keyword to sysfs path constructor. Change-Id: I320ace928a52d8c91a966cc88f4ceec35d744e9d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Replace include guards with #pragma onceBrad Bishop2017-01-136-24/+7
| | | | | Change-Id: I16adc78d397e3239440206e8e70ebbd5e0963adb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Grab DBus connectionBrad Bishop2017-01-134-8/+40
| | | | | | | | 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-135-5/+39
| | | | | | | | 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 Sensor.Value server bindingsBrad Bishop2017-01-133-1/+445
| | | | | | | | Temporarily add the server bindings for xyz.openbmc_project.Sensor.Value until they are available elsewhere. Change-Id: Ic04b88e4ef08308ce57732eca74407d5248050cf Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Link systemdBrad Bishop2017-01-132-2/+7
| | | | | | | Prepare for DBus. Change-Id: I59b63202db603b5137d7dce62e03f1cde177e675 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud