Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 5 | #include <vector> |
| 6 | |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 7 | #include "libpldm/bios.h" |
| 8 | |
| 9 | namespace pldm |
| 10 | { |
| 11 | |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 12 | using Response = std::vector<uint8_t>; |
| 13 | |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 14 | namespace responder |
| 15 | { |
| 16 | |
Jinu Joy Thomas | f666db1 | 2019-05-29 05:22:31 -0500 | [diff] [blame] | 17 | namespace bios |
| 18 | { |
| 19 | /** @brief Register handlers for command from the platform spec |
| 20 | */ |
| 21 | void registerHandlers(); |
| 22 | } // namespace bios |
| 23 | |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 24 | /** @brief Handler for GetDateTime |
| 25 | * |
| 26 | * @param[in] request - Request message payload |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 27 | * @param[return] Response - PLDM Response message |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 28 | */ |
Jinu Joy Thomas | f666db1 | 2019-05-29 05:22:31 -0500 | [diff] [blame] | 29 | Response getDateTime(const pldm_msg* request, size_t payloadLength); |
Sampa Misra | 032bd50 | 2019-03-06 05:03:22 -0600 | [diff] [blame] | 30 | |
| 31 | namespace 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 | */ |
| 44 | void 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 |