mainloop cleanup: moved getAttrs to hwmon namespace

Moved the code that maps a sensor type to its dbus and
hwmon components from mainloop to the hwmon namespace.

Change-Id: I7963951c9484c02d17a3eb415906859609e0efd3
Signed-off-by: Patrick Venture <venture@google.com>
4 files changed
tree: 568d83925f974a2eae2653865251147b34d5ded1
  1. msl/
  2. test/
  3. .gitignore
  4. argument.cpp
  5. argument.hpp
  6. bootstrap.sh
  7. configure.ac
  8. env.cpp
  9. env.hpp
  10. fan_pwm.cpp
  11. fan_pwm.hpp
  12. fan_speed.cpp
  13. fan_speed.hpp
  14. hwmon.cpp
  15. hwmon.hpp
  16. interface.hpp
  17. LICENSE
  18. mainloop.cpp
  19. mainloop.hpp
  20. Makefile.am
  21. readd.cpp
  22. README.iio.md
  23. README.md
  24. sensorset.cpp
  25. sensorset.hpp
  26. sysfs.cpp
  27. sysfs.hpp
  28. targets.hpp
  29. thresholds.hpp
  30. timer.cpp
  31. timer.hpp
  32. util.hpp
README.md

Exposes generic hwmon entries as DBus objects.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To clean the repository run `./bootstrap.sh clean`.

D-Bus bus names

To enable the use of Linux features like cgroups prioritization and
udev/systemd control, one instance of phosphor-hwmon is intended to
be run per hwmon sysfs class instance.

This requires an algorithm for selecting a stable, well-known D-Bus busname.

The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf
configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default),
ID is a std::hash of the /sys/devices path backing the hwmon class
instance, and N is the implemented phosphor-hwmon D-Bus API version.