blob: 36f7ccbe08b116ffc8a741b1e798fb56bec6dde8 [file] [log] [blame]
Manojkiran Edad94bb832021-02-17 11:40:22 +05301#pragma once
2
3#include "file_io_by_type.hpp"
4
5namespace pldm
6{
7
8namespace 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 */
16class ProgressCodeHandler : public FileHandler
17{
18 public:
19 /** @brief ProgressCodeHandler constructor
20 */
Patrick Williams6da4f912023-05-10 07:50:53 -050021 ProgressCodeHandler(uint32_t fileHandle) : FileHandler(fileHandle) {}
Manojkiran Edad94bb832021-02-17 11:40:22 +053022
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 Williams6da4f912023-05-10 07:50:53 -050067 ~ProgressCodeHandler() {}
Manojkiran Edad94bb832021-02-17 11:40:22 +053068};
69
70} // namespace responder
71} // namespace pldm