summaryrefslogtreecommitdiffstats
path: root/bmc_state_manager.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2018-07-12 16:05:55 -0500
committerMatt Spinler <spinler@us.ibm.com>2018-07-24 09:38:24 -0500
commite6710b7ecef38eef8f927fd7fec6ad433bb00ce2 (patch)
tree45f5c39ab99ff134db6a6e5e27f0a8ae0c39f566 /bmc_state_manager.hpp
parent9a2f37cf223312f7a69bf924eb1ad63c93424109 (diff)
downloadphosphor-state-manager-e6710b7ecef38eef8f927fd7fec6ad433bb00ce2.tar.gz
phosphor-state-manager-e6710b7ecef38eef8f927fd7fec6ad433bb00ce2.zip
BMC state manager support for LastRebootTime
Use the uptime value to calculate the time of the last BMC reboot when the LastRebootTime property is read. Calculates it on the fly instead of once at startup so that if someone changes the BMC time the value will still be accurate. Resolves openbmc/openbmc#3159 Tested: Verify the property returns the right value. Change-Id: I4bc8d2cdf18c225b24c98d9567d053c3246b7506 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'bmc_state_manager.hpp')
-rw-r--r--bmc_state_manager.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/bmc_state_manager.hpp b/bmc_state_manager.hpp
index b060ccd..c55c822 100644
--- a/bmc_state_manager.hpp
+++ b/bmc_state_manager.hpp
@@ -50,6 +50,16 @@ class BMC : public BMCInherit
/** @brief Set value of CurrentBMCState **/
BMCState currentBMCState(BMCState value) override;
+ /** @brief Returns the last time the BMC was rebooted
+ *
+ * @details Uses uptime information to determine when
+ * the BMC was last rebooted.
+ *
+ * @return uint64_t - Epoch time, in milliseconds, of the
+ * last reboot.
+ */
+ uint64_t lastRebootTime() const override;
+
private:
/**
* @brief discover the state of the bmc
OpenPOWER on IntegriCloud