Patrick Venture | 863b924 | 2018-03-08 08:29:23 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | |
| 5 | struct SensorProperties |
| 6 | { |
| 7 | int64_t scale; |
| 8 | int64_t value; |
| 9 | std::string unit; |
| 10 | }; |
| 11 | |
| 12 | /* |
| 13 | * Retrieve the dbus bus (or service) for the given object and interface. |
| 14 | */ |
| 15 | std::string GetService(sdbusplus::bus::bus& bus, |
| 16 | const std::string& intf, |
| 17 | const std::string& path); |
| 18 | |
| 19 | void GetProperties(sdbusplus::bus::bus& bus, |
| 20 | const std::string& service, |
| 21 | const std::string& path, |
| 22 | struct SensorProperties* prop); |
| 23 | |
| 24 | std::string GetSensorPath(const std::string& type, const std::string& id); |
| 25 | std::string GetMatch(const std::string& type, const std::string& id); |
| 26 | |
| 27 | const std::string sensorintf = "xyz.openbmc_project.Sensor.Value"; |
| 28 | const std::string propertiesintf = "org.freedesktop.DBus.Properties"; |
| 29 | |