1 #pragma once
2 
3 #include <cstdint>
4 #include <string>
5 
6 namespace pid_control
7 {
8 
9 struct SensorProperties
10 {
11     int64_t scale;
12     double value;
13     double min;
14     double max;
15     std::string unit;
16 };
17 
18 class DbusHelperInterface
19 {
20   public:
21     virtual ~DbusHelperInterface() = default;
22 
23     /** @brief Get the service providing the interface for the path.
24      *
25      * @warning Throws exception on dbus failure.
26      */
27     virtual std::string getService(const std::string& intf,
28                                    const std::string& path) = 0;
29 
30     /** @brief Get all Sensor.Value properties for a service and path.
31      *
32      * @param[in] bus - A bus to use for the call.
33      * @param[in] service - The service providing the interface.
34      * @param[in] path - The dbus path.
35      * @param[out] prop - A pointer to a properties to fill out.
36      *
37      * @warning Throws exception on dbus failure.
38      */
39     virtual void getProperties(const std::string& service,
40                                const std::string& path,
41                                SensorProperties* prop) = 0;
42 
43     /** @brief Get Critical Threshold current assert status
44      *
45      * @param[in] bus - A bus to use for the call.
46      * @param[in] service - The service providing the interface.
47      * @param[in] path - The dbus path.
48      */
49     virtual bool thresholdsAsserted(const std::string& service,
50                                     const std::string& path) = 0;
51 };
52 
53 } // namespace pid_control
54