blob: 45ee4c706ad1727661bc462aa6f6bf8fa43df4e6 [file] [log] [blame]
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +02001#pragma once
2
3#include <boost/asio.hpp>
4#include <sdbusplus/asio/connection.hpp>
5#include <sdbusplus/asio/object_server.hpp>
6#include <sdbusplus/bus.hpp>
7
8namespace stubs
9{
10
11class DbusSensorObject
12{
13 public:
14 DbusSensorObject(
15 boost::asio::io_context& ioc,
16 const std::shared_ptr<sdbusplus::asio::connection>& bus,
17 const std::shared_ptr<sdbusplus::asio::object_server>& objServer);
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020018
19 static const char* path();
20 static const char* interface();
21
22 void setValue(double);
23 double getValue() const;
24
25 struct Properties
26 {
27 static const char* value();
28 };
29
30 static constexpr Properties property = {};
31
32 private:
33 boost::asio::io_context& ioc;
34 std::shared_ptr<sdbusplus::asio::connection> bus;
35 std::shared_ptr<sdbusplus::asio::object_server> objServer;
36
Wludzik, Jozef5ade2b12020-11-16 14:00:23 +010037 std::unique_ptr<sdbusplus::asio::dbus_interface> sensorIface;
Krzysztof Grobelnyb5645942020-09-29 11:52:45 +020038
39 double value = 0.0;
40};
41
42} // namespace stubs