xref: /openbmc/pldm/libpldmresponder/bios.hpp (revision 032bd50af11947d8bd0a40f097c540e948dcfbae)
1 #pragma once
2 
3 #include <stdint.h>
4 
5 #include "libpldm/bios.h"
6 
7 namespace pldm
8 {
9 
10 namespace responder
11 {
12 
13 /** @brief Handler for GetDateTime
14  *
15  *  @param[in] request - Request message payload
16  *  @param[out] response - Response message written here
17  */
18 void getDateTime(const pldm_msg_payload* request, pldm_msg* response);
19 
20 namespace utils
21 {
22 
23 /** @brief Convert epoch time to BCD time
24  *
25  *  @param[in] timeSec - Time got from epoch time in seconds
26  *  @param[out] seconds - number of seconds in BCD
27  *  @param[out] minutes - number of minutes in BCD
28  *  @param[out] hours - number of hours in BCD
29  *  @param[out] day - day of the month in BCD
30  *  @param[out] month - month number in BCD
31  *  @param[out] year - year number in BCD
32  */
33 void epochToBCDTime(uint64_t timeSec, uint8_t& seconds, uint8_t& minutes,
34                     uint8_t& hours, uint8_t& day, uint8_t& month,
35                     uint16_t& year);
36 } // namespace utils
37 
38 } // namespace responder
39 } // namespace pldm
40