xref: /openbmc/phosphor-ipmi-flash/tools/p2a.hpp (revision e5aafa5b)
1 #pragma once
2 
3 #include "interface.hpp"
4 #include "internal/sys.hpp"
5 #include "pci.hpp"
6 #include "progress.hpp"
7 
8 #include <ipmiblob/blob_interface.hpp>
9 
10 #include <cstdint>
11 #include <vector>
12 
13 namespace host_tool
14 {
15 
16 class P2aDataHandler : public DataInterface
17 {
18   public:
19     P2aDataHandler(ipmiblob::BlobInterface* blob, const PciAccess* pci,
20                    ProgressInterface* progress,
21                    const internal::Sys* sys = &internal::sys_impl) :
22         blob(blob),
23         pci(pci), progress(progress), sys(sys)
24     {}
25 
26     bool sendContents(const std::string& input, std::uint16_t session) override;
27     ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const override
28     {
29         return ipmi_flash::FirmwareFlags::UpdateFlags::p2a;
30     }
31 
32   private:
33     ipmiblob::BlobInterface* blob;
34     const PciAccess* pci;
35     ProgressInterface* progress;
36     const internal::Sys* sys;
37 };
38 
39 } // namespace host_tool
40