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