Initial implementation of Telemetry service
Implemented main application of Telemetry service.
Added ReportManager interface. Added MaxReports and
PollRateResolution properties to ReportManager interface.
Implemented simple logger.
Tested:
- Built without Yocto and ran on x86 platform with success
- Added telemetry to romulus image using
recipe-phosphor/telemetry from meta-phosphor repository
- Started as service in romulus image in QEMU with success
- Verified that all added properties are present in dbus
Change-Id: I26af7a19b1f9cac32e9e9da65523d72a36e13855
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/src/report_manager.cpp b/src/report_manager.cpp
new file mode 100644
index 0000000..9735abd
--- /dev/null
+++ b/src/report_manager.cpp
@@ -0,0 +1,30 @@
+#include "report_manager.hpp"
+
+#include <system_error>
+
+constexpr const char* reportManagerIfaceName =
+ "xyz.openbmc_project.Telemetry.ReportManager";
+constexpr const char* reportManagerPath =
+ "/xyz/openbmc_project/Telemetry/Reports";
+
+ReportManager::ReportManager(
+ const std::shared_ptr<sdbusplus::asio::object_server>& objServer) :
+ objServer(objServer)
+{
+ reportManagerIntf =
+ objServer->add_interface(reportManagerPath, reportManagerIfaceName);
+
+ reportManagerIntf->register_property_r(
+ "MaxReports", uint32_t{}, sdbusplus::vtable::property_::const_,
+ [](const auto&) { return maxReports; });
+ reportManagerIntf->register_property_r(
+ "MinInterval", uint64_t{}, sdbusplus::vtable::property_::const_,
+ [](const auto&) -> uint64_t { return minInterval.count(); });
+
+ reportManagerIntf->initialize();
+}
+
+ReportManager::~ReportManager()
+{
+ objServer->remove_interface(reportManagerIntf);
+}