system: RAUC operation and last error properties
This patch implements getting the current operation and last error from
the RAUC via its D-Bus interface [1].
We need to access those properties in order to provide the data about
installation process in the czechlight-system model.
[1] https://rauc.readthedocs.io/en/v1.4/reference.html#properties
Change-Id: Ie1daf89e11be2d72e1ef5a0c9e80a316ed09ab41
diff --git a/src/system/RAUC.cpp b/src/system/RAUC.cpp
index 9ec11eb..4338446 100644
--- a/src/system/RAUC.cpp
+++ b/src/system/RAUC.cpp
@@ -120,4 +120,14 @@
{
m_dbusObjectProxy->callMethod("InstallBundle").onInterface(INTERFACE).withArguments(source, std::map<std::string, sdbus::Variant> {});
}
+
+std::string RAUC::operation() const
+{
+ return m_dbusObjectProxy->getProperty("Operation").onInterface(INTERFACE);
+}
+
+std::string RAUC::lastError() const
+{
+ return m_dbusObjectProxy->getProperty("LastError").onInterface(INTERFACE);
+}
}