Sampa Misra | 854e61f | 2019-08-22 04:36:47 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "file_io_by_type.hpp" |
| 4 | |
| 5 | namespace pldm |
| 6 | { |
| 7 | namespace responder |
| 8 | { |
| 9 | |
| 10 | using 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 | */ |
| 17 | class 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 Kodihalli | 75e02f8 | 2019-11-20 02:51:05 -0600 | [diff] [blame] | 28 | virtual int readIntoMemory(uint32_t offset, uint32_t& length, |
Deepak Kodihalli | f6d3a83 | 2019-11-19 07:00:29 -0600 | [diff] [blame] | 29 | uint64_t address); |
Deepak Kodihalli | 75e02f8 | 2019-11-20 02:51:05 -0600 | [diff] [blame] | 30 | virtual int read(uint32_t offset, uint32_t& length, Response& response); |
Sampa Misra | 854e61f | 2019-08-22 04:36:47 -0500 | [diff] [blame] | 31 | |
| 32 | /** @brief method to store a pel file in tempfs and send |
| 33 | * d-bus notification to pel daemon that it is ready for consumption |
| 34 | * |
| 35 | * @param[in] pelFileName - the pel file path |
| 36 | */ |
| 37 | virtual int storePel(std::string&& pelFileName); |
| 38 | |
| 39 | /** @brief PelHandler destructor |
| 40 | */ |
| 41 | ~PelHandler() |
| 42 | { |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | } // namespace responder |
| 47 | } // namespace pldm |