Manojkiran Eda | d94bb83 | 2021-02-17 11:40:22 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "file_io_by_type.hpp" |
| 4 | |
| 5 | namespace pldm |
| 6 | { |
| 7 | |
| 8 | namespace responder |
| 9 | { |
| 10 | |
| 11 | /** @class ProgressCodeHandler |
| 12 | * |
| 13 | * @brief Inherits and implemented FileHandler. This class is used |
| 14 | * to read the Progress SRC's from the Host. |
| 15 | */ |
| 16 | class ProgressCodeHandler : public FileHandler |
| 17 | { |
| 18 | public: |
| 19 | /** @brief ProgressCodeHandler constructor |
| 20 | */ |
Patrick Williams | 6da4f91 | 2023-05-10 07:50:53 -0500 | [diff] [blame] | 21 | ProgressCodeHandler(uint32_t fileHandle) : FileHandler(fileHandle) {} |
Manojkiran Eda | d94bb83 | 2021-02-17 11:40:22 +0530 | [diff] [blame] | 22 | |
| 23 | int writeFromMemory(uint32_t /*offset*/, uint32_t /*length*/, |
| 24 | uint64_t /*address*/, |
| 25 | oem_platform::Handler* /*oemPlatformHandler*/) override |
| 26 | { |
| 27 | return PLDM_ERROR_UNSUPPORTED_PLDM_CMD; |
| 28 | } |
| 29 | |
| 30 | int write(const char* buffer, uint32_t offset, uint32_t& length, |
| 31 | oem_platform::Handler* oemPlatformHandler) override; |
| 32 | |
| 33 | int readIntoMemory(uint32_t /*offset*/, uint32_t& /*length*/, |
| 34 | uint64_t /*address*/, |
| 35 | oem_platform::Handler* /*oemPlatformHandler*/) override |
| 36 | { |
| 37 | return PLDM_ERROR_UNSUPPORTED_PLDM_CMD; |
| 38 | } |
| 39 | |
| 40 | int read(uint32_t /*offset*/, uint32_t& /*length*/, Response& /*response*/, |
| 41 | oem_platform::Handler* /*oemPlatformHandler*/) override |
| 42 | { |
| 43 | return PLDM_ERROR_UNSUPPORTED_PLDM_CMD; |
| 44 | } |
| 45 | |
| 46 | int fileAck(uint8_t /*fileStatus*/) override |
| 47 | { |
| 48 | return PLDM_ERROR_UNSUPPORTED_PLDM_CMD; |
| 49 | } |
| 50 | |
| 51 | int newFileAvailable(uint64_t /*length*/) override |
| 52 | { |
| 53 | return PLDM_ERROR_UNSUPPORTED_PLDM_CMD; |
| 54 | } |
| 55 | |
| 56 | /** @brief method to set the dbus Raw value Property with |
| 57 | * the obtained progress code from the host. |
| 58 | * |
| 59 | * @param[in] progressCodeBuffer - the progress Code SRC Buffer |
| 60 | */ |
| 61 | virtual int setRawBootProperty( |
| 62 | const std::tuple<uint64_t, std::vector<uint8_t>>& progressCodeBuffer); |
| 63 | |
| 64 | /** @brief ProgressCodeHandler destructor |
| 65 | */ |
| 66 | |
Patrick Williams | 6da4f91 | 2023-05-10 07:50:53 -0500 | [diff] [blame] | 67 | ~ProgressCodeHandler() {} |
Manojkiran Eda | d94bb83 | 2021-02-17 11:40:22 +0530 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | } // namespace responder |
| 71 | } // namespace pldm |