blob: 2befe2412a7feed4f96c4f8945e839da54f451b3 [file] [log] [blame]
Sampa Misra032bd502019-03-06 05:03:22 -06001#pragma once
2
3#include <stdint.h>
4
vkaverapa6575b82019-04-03 05:33:52 -05005#include <vector>
6
Sampa Misra032bd502019-03-06 05:03:22 -06007#include "libpldm/bios.h"
8
9namespace pldm
10{
11
vkaverapa6575b82019-04-03 05:33:52 -050012using Response = std::vector<uint8_t>;
13
Sampa Misra032bd502019-03-06 05:03:22 -060014namespace responder
15{
16
Jinu Joy Thomasf666db12019-05-29 05:22:31 -050017namespace bios
18{
19/** @brief Register handlers for command from the platform spec
20 */
21void registerHandlers();
22} // namespace bios
23
Sampa Misra032bd502019-03-06 05:03:22 -060024/** @brief Handler for GetDateTime
25 *
26 * @param[in] request - Request message payload
vkaverapa6575b82019-04-03 05:33:52 -050027 * @param[return] Response - PLDM Response message
Sampa Misra032bd502019-03-06 05:03:22 -060028 */
Jinu Joy Thomasf666db12019-05-29 05:22:31 -050029Response getDateTime(const pldm_msg* request, size_t payloadLength);
Sampa Misra032bd502019-03-06 05:03:22 -060030
31namespace utils
32{
33
34/** @brief Convert epoch time to BCD time
35 *
36 * @param[in] timeSec - Time got from epoch time in seconds
37 * @param[out] seconds - number of seconds in BCD
38 * @param[out] minutes - number of minutes in BCD
39 * @param[out] hours - number of hours in BCD
40 * @param[out] day - day of the month in BCD
41 * @param[out] month - month number in BCD
42 * @param[out] year - year number in BCD
43 */
44void epochToBCDTime(uint64_t timeSec, uint8_t& seconds, uint8_t& minutes,
45 uint8_t& hours, uint8_t& day, uint8_t& month,
46 uint16_t& year);
47} // namespace utils
48
49} // namespace responder
50} // namespace pldm