blob: 9735abd3dde57c995bcf79d4b9f34e5f0a78fd78 [file] [log] [blame]
Krzysztof Grobelny64b75a52020-09-18 10:17:16 +02001#include "report_manager.hpp"
2
3#include <system_error>
4
5constexpr const char* reportManagerIfaceName =
6 "xyz.openbmc_project.Telemetry.ReportManager";
7constexpr const char* reportManagerPath =
8 "/xyz/openbmc_project/Telemetry/Reports";
9
10ReportManager::ReportManager(
11 const std::shared_ptr<sdbusplus::asio::object_server>& objServer) :
12 objServer(objServer)
13{
14 reportManagerIntf =
15 objServer->add_interface(reportManagerPath, reportManagerIfaceName);
16
17 reportManagerIntf->register_property_r(
18 "MaxReports", uint32_t{}, sdbusplus::vtable::property_::const_,
19 [](const auto&) { return maxReports; });
20 reportManagerIntf->register_property_r(
21 "MinInterval", uint64_t{}, sdbusplus::vtable::property_::const_,
22 [](const auto&) -> uint64_t { return minInterval.count(); });
23
24 reportManagerIntf->initialize();
25}
26
27ReportManager::~ReportManager()
28{
29 objServer->remove_interface(reportManagerIntf);
30}