summaryrefslogtreecommitdiffstats
path: root/app/watchdog_service.hpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-08-31 11:55:55 -0700
committerPatrick Venture <venture@google.com>2018-09-07 23:45:41 +0000
commit0b02be925a29357f69abbc9e9a58e7c5aaed2eab (patch)
treec1b39f817d98ffda7b987f9e3f864f576e3bf9ea /app/watchdog_service.hpp
parent26f80ab2cc41deadc913190d906f71266c4ed224 (diff)
downloadphosphor-host-ipmid-0b02be925a29357f69abbc9e9a58e7c5aaed2eab.tar.gz
phosphor-host-ipmid-0b02be925a29357f69abbc9e9a58e7c5aaed2eab.zip
add .clang-format
Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'app/watchdog_service.hpp')
-rw-r--r--app/watchdog_service.hpp165
1 files changed, 84 insertions, 81 deletions
diff --git a/app/watchdog_service.hpp b/app/watchdog_service.hpp
index dfc913a..8056fb7 100644
--- a/app/watchdog_service.hpp
+++ b/app/watchdog_service.hpp
@@ -1,104 +1,107 @@
#pragma once
+#include "utils.hpp"
+
#include <sdbusplus/bus.hpp>
#include <xyz/openbmc_project/State/Watchdog/server.hpp>
-#include "utils.hpp"
-
/** @class WatchdogService
* @brief Access to the running OpenBMC watchdog implementation.
* @details Easy accessor for servers that implement the
* xyz.openbmc_project.State.Watchdog DBus API.
*/
-class WatchdogService {
- public:
- WatchdogService();
+class WatchdogService
+{
+ public:
+ WatchdogService();
- using Action = sdbusplus::xyz::openbmc_project::State::server::Watchdog::Action;
+ using Action =
+ sdbusplus::xyz::openbmc_project::State::server::Watchdog::Action;
- /** @brief Resets the time remaining on the watchdog.
- * Equivalent to setTimeRemaining(getInterval()).
- * Optionally enables the watchdog.
- *
- * @param[in] enableWatchdog - Should the call also enable the watchdog
- */
- void resetTimeRemaining(bool enableWatchdog);
+ /** @brief Resets the time remaining on the watchdog.
+ * Equivalent to setTimeRemaining(getInterval()).
+ * Optionally enables the watchdog.
+ *
+ * @param[in] enableWatchdog - Should the call also enable the watchdog
+ */
+ void resetTimeRemaining(bool enableWatchdog);
- /** @brief Contains a copy of the properties enumerated by the
- * watchdog service.
- */
- struct Properties {
- bool initialized;
- bool enabled;
- Action expireAction;
- uint64_t interval;
- uint64_t timeRemaining;
- };
+ /** @brief Contains a copy of the properties enumerated by the
+ * watchdog service.
+ */
+ struct Properties
+ {
+ bool initialized;
+ bool enabled;
+ Action expireAction;
+ uint64_t interval;
+ uint64_t timeRemaining;
+ };
- /** @brief Retrieves a copy of the currently set properties on the
- * host watchdog
- *
- * @return A populated WatchdogProperties struct
- */
- Properties getProperties();
+ /** @brief Retrieves a copy of the currently set properties on the
+ * host watchdog
+ *
+ * @return A populated WatchdogProperties struct
+ */
+ Properties getProperties();
- /** @brief Get the value of the initialized property on the host
- * watchdog
- *
- * @return The value of the property
- */
- bool getInitialized();
+ /** @brief Get the value of the initialized property on the host
+ * watchdog
+ *
+ * @return The value of the property
+ */
+ bool getInitialized();
- /** @brief Sets the value of the initialized property on the host
- * watchdog
- *
- * @param[in] initialized - The new initializedvalue
- */
- void setInitialized(bool initialized);
+ /** @brief Sets the value of the initialized property on the host
+ * watchdog
+ *
+ * @param[in] initialized - The new initializedvalue
+ */
+ void setInitialized(bool initialized);
- /** @brief Sets the value of the enabled property on the host watchdog
- *
- * @param[in] enabled - The new enabled value
- */
- void setEnabled(bool enabled);
+ /** @brief Sets the value of the enabled property on the host watchdog
+ *
+ * @param[in] enabled - The new enabled value
+ */
+ void setEnabled(bool enabled);
- /** @brief Sets the value of the expireAction property on the host watchdog
- *
- * @param[in] expireAction - The new expireAction value
- */
- void setExpireAction(Action expireAction);
+ /** @brief Sets the value of the expireAction property on the host watchdog
+ *
+ * @param[in] expireAction - The new expireAction value
+ */
+ void setExpireAction(Action expireAction);
- /** @brief Sets the value of the interval property on the host watchdog
- *
- * @param[in] interval - The new interval value
- */
- void setInterval(uint64_t interval);
+ /** @brief Sets the value of the interval property on the host watchdog
+ *
+ * @param[in] interval - The new interval value
+ */
+ void setInterval(uint64_t interval);
- /** @brief Sets the value of the timeRemaining property on the host
- * watchdog
- *
- * @param[in] timeRemaining - The new timeRemaining value
- */
- void setTimeRemaining(uint64_t timeRemaining);
+ /** @brief Sets the value of the timeRemaining property on the host
+ * watchdog
+ *
+ * @param[in] timeRemaining - The new timeRemaining value
+ */
+ void setTimeRemaining(uint64_t timeRemaining);
- private:
- /** @brief sdbusplus handle */
- sdbusplus::bus::bus bus;
- /** @brief The name of the mapped host watchdog service */
- static ipmi::ServiceCache wd_service;
+ private:
+ /** @brief sdbusplus handle */
+ sdbusplus::bus::bus bus;
+ /** @brief The name of the mapped host watchdog service */
+ static ipmi::ServiceCache wd_service;
- /** @brief Gets the value of the property on the host watchdog
- *
- * @param[in] key - The name of the property
- * @return The value of the property
- */
- template <typename T>
- T getProperty(const std::string& key);
+ /** @brief Gets the value of the property on the host watchdog
+ *
+ * @param[in] key - The name of the property
+ * @return The value of the property
+ */
+ template <typename T>
+ T getProperty(const std::string& key);
- /** @brief Sets the value of the property on the host watchdog
- *
- * @param[in] key - The name of the property
- * @param[in] val - The new value
- */
- template <typename T>
- void setProperty(const std::string& key, const T& val);
+ /** @brief Sets the value of the property on the host watchdog
+ *
+ * @param[in] key - The name of the property
+ * @param[in] val - The new value
+ */
+ template <typename T>
+ void setProperty(const std::string& key, const T& val);
};
OpenPOWER on IntegriCloud