Sensor Objects

This includes all the sensor objects including a few
implementations, including dbus and sysfs sensors.

Change-Id: I9897c79f9fd463f00f0e02aeb6c32ffa89635dbe
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/dbus/util.hpp b/dbus/util.hpp
new file mode 100644
index 0000000..3ff2424
--- /dev/null
+++ b/dbus/util.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <sdbusplus/bus.hpp>
+
+struct SensorProperties
+{
+    int64_t scale;
+    int64_t value;
+    std::string unit;
+};
+
+/*
+ * Retrieve the dbus bus (or service) for the given object and interface.
+ */
+std::string GetService(sdbusplus::bus::bus& bus,
+                       const std::string& intf,
+                       const std::string& path);
+
+void GetProperties(sdbusplus::bus::bus& bus,
+                   const std::string& service,
+                   const std::string& path,
+                   struct SensorProperties* prop);
+
+std::string GetSensorPath(const std::string& type, const std::string& id);
+std::string GetMatch(const std::string& type, const std::string& id);
+
+const std::string sensorintf = "xyz.openbmc_project.Sensor.Value";
+const std::string propertiesintf = "org.freedesktop.DBus.Properties";
+