blob: 34f49070b8eea81edfecb9c2870c5a5e5731ee14 [file] [log] [blame]
Sampa Misra854e61f2019-08-22 04:36:47 -05001#pragma once
2
3#include "file_io_by_type.hpp"
4
5namespace pldm
6{
7namespace responder
8{
9
10using namespace pldm::responder::dma;
11
12/** @class PelHandler
13 *
14 * @brief Inherits and implements FileHandler. This class is used
15 * to read/write pels.
16 */
17class PelHandler : public FileHandler
18{
19 public:
20 /** @brief PelHandler constructor
21 */
22 PelHandler(uint32_t fileHandle) : FileHandler(fileHandle)
23 {
24 }
25
26 virtual int writeFromMemory(uint32_t offset, uint32_t length,
27 uint64_t address);
Deepak Kodihalli75e02f82019-11-20 02:51:05 -060028 virtual int readIntoMemory(uint32_t offset, uint32_t& length,
Deepak Kodihallif6d3a832019-11-19 07:00:29 -060029 uint64_t address);
Deepak Kodihalli75e02f82019-11-20 02:51:05 -060030 virtual int read(uint32_t offset, uint32_t& length, Response& response);
Sampa Misra854e61f2019-08-22 04:36:47 -050031
Deepak Kodihalli2da1bfe2019-12-14 08:28:09 -060032 virtual int fileAck(uint8_t fileStatus);
33
Sampa Misra854e61f2019-08-22 04:36:47 -050034 /** @brief method to store a pel file in tempfs and send
35 * d-bus notification to pel daemon that it is ready for consumption
36 *
37 * @param[in] pelFileName - the pel file path
38 */
39 virtual int storePel(std::string&& pelFileName);
40
41 /** @brief PelHandler destructor
42 */
43 ~PelHandler()
44 {
45 }
46};
47
48} // namespace responder
49} // namespace pldm