Implement part of BmcEpoch
Add BmcEpoch which inherits EpochBase and will handle times for BMC,
it is partly implemented.
Add unit test cases to test basic functions.
Change-Id: Ia5e4d0f884156d238f3f84df490a2efbce43e89a
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/bmc_epoch.hpp b/bmc_epoch.hpp
new file mode 100644
index 0000000..56d78e9
--- /dev/null
+++ b/bmc_epoch.hpp
@@ -0,0 +1,39 @@
+#pragma once
+
+#include "epoch_base.hpp"
+
+namespace phosphor
+{
+namespace time
+{
+
+/** @class BmcEpoch
+ * @brief OpenBMC BMC EpochTime implementation.
+ * @details A concrete implementation for xyz.openbmc_project.Time.EpochTime
+ * DBus API for BMC's epoch time.
+ */
+class BmcEpoch : public EpochBase
+{
+ public:
+ friend class TestBmcEpoch;
+ BmcEpoch(sdbusplus::bus::bus& bus,
+ const char* objPath);
+
+ /**
+ * @brief Get value of Elapsed property
+ *
+ * @return The elapsed microseconds since UTC
+ **/
+ uint64_t elapsed() const override;
+
+ /**
+ * @brief Set value of Elapsed property
+ *
+ * @param[in] value - The microseconds since UTC to set
+ * @return The updated elapsed microseconds since UTC
+ **/
+ uint64_t elapsed(uint64_t value) override;
+};
+
+}
+}