blob: 3ff242460c4af6dfe011295ef9c74b99c28ea30d [file] [log] [blame]
Patrick Venture863b9242018-03-08 08:29:23 -08001#pragma once
2
3#include <sdbusplus/bus.hpp>
4
5struct 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 */
15std::string GetService(sdbusplus::bus::bus& bus,
16 const std::string& intf,
17 const std::string& path);
18
19void GetProperties(sdbusplus::bus::bus& bus,
20 const std::string& service,
21 const std::string& path,
22 struct SensorProperties* prop);
23
24std::string GetSensorPath(const std::string& type, const std::string& id);
25std::string GetMatch(const std::string& type, const std::string& id);
26
27const std::string sensorintf = "xyz.openbmc_project.Sensor.Value";
28const std::string propertiesintf = "org.freedesktop.DBus.Properties";
29