xref: /openbmc/phosphor-time-manager/bmc_epoch.hpp (revision 962328277259ce12115fa6bf7ae31f43f1951dd0)
1*96232827SLei YU #pragma once
2*96232827SLei YU 
3*96232827SLei YU #include "epoch_base.hpp"
4*96232827SLei YU 
5*96232827SLei YU namespace phosphor
6*96232827SLei YU {
7*96232827SLei YU namespace time
8*96232827SLei YU {
9*96232827SLei YU 
10*96232827SLei YU /** @class BmcEpoch
11*96232827SLei YU  *  @brief OpenBMC BMC EpochTime implementation.
12*96232827SLei YU  *  @details A concrete implementation for xyz.openbmc_project.Time.EpochTime
13*96232827SLei YU  *  DBus API for BMC's epoch time.
14*96232827SLei YU  */
15*96232827SLei YU class BmcEpoch : public EpochBase
16*96232827SLei YU {
17*96232827SLei YU     public:
18*96232827SLei YU         friend class TestBmcEpoch;
19*96232827SLei YU         BmcEpoch(sdbusplus::bus::bus& bus,
20*96232827SLei YU                  const char* objPath);
21*96232827SLei YU 
22*96232827SLei YU         /**
23*96232827SLei YU          * @brief Get value of Elapsed property
24*96232827SLei YU          *
25*96232827SLei YU          * @return The elapsed microseconds since UTC
26*96232827SLei YU          **/
27*96232827SLei YU         uint64_t elapsed() const override;
28*96232827SLei YU 
29*96232827SLei YU         /**
30*96232827SLei YU          * @brief Set value of Elapsed property
31*96232827SLei YU          *
32*96232827SLei YU          * @param[in] value - The microseconds since UTC to set
33*96232827SLei YU          * @return The updated elapsed microseconds since UTC
34*96232827SLei YU          **/
35*96232827SLei YU         uint64_t elapsed(uint64_t value) override;
36*96232827SLei YU };
37*96232827SLei YU 
38*96232827SLei YU }
39*96232827SLei YU }
40