blob: a223f1a63c3ed77e70237939ef2ac8aa450fffa7 [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 */
21 ProgressCodeHandler(uint32_t fileHandle) : FileHandler(fileHandle)
22 {}
23
24 int writeFromMemory(uint32_t /*offset*/, uint32_t /*length*/,
25 uint64_t /*address*/,
26 oem_platform::Handler* /*oemPlatformHandler*/) override
27 {
28 return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
29 }
30
31 int write(const char* buffer, uint32_t offset, uint32_t& length,
32 oem_platform::Handler* oemPlatformHandler) override;
33
34 int readIntoMemory(uint32_t /*offset*/, uint32_t& /*length*/,
35 uint64_t /*address*/,
36 oem_platform::Handler* /*oemPlatformHandler*/) override
37 {
38 return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
39 }
40
41 int read(uint32_t /*offset*/, uint32_t& /*length*/, Response& /*response*/,
42 oem_platform::Handler* /*oemPlatformHandler*/) override
43 {
44 return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
45 }
46
47 int fileAck(uint8_t /*fileStatus*/) override
48 {
49 return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
50 }
51
52 int newFileAvailable(uint64_t /*length*/) override
53 {
54 return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
55 }
56
57 /** @brief method to set the dbus Raw value Property with
58 * the obtained progress code from the host.
59 *
60 * @param[in] progressCodeBuffer - the progress Code SRC Buffer
61 */
62 virtual int setRawBootProperty(
63 const std::tuple<uint64_t, std::vector<uint8_t>>& progressCodeBuffer);
64
65 /** @brief ProgressCodeHandler destructor
66 */
67
68 ~ProgressCodeHandler()
69 {}
70};
71
72} // namespace responder
73} // namespace pldm