blob: 08153d2bf6d5e471bb47dd462d722448bb31fe29 [file] [log] [blame]
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -07001#pragma once
2
3#include "interface.hpp"
Patrick Venture18bbe3c2019-05-14 11:40:57 -07004#include "internal/sys.hpp"
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -07005#include "pci.hpp"
Patrick Venturecf9b2192019-06-27 12:09:52 -07006#include "progress.hpp"
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -07007
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -07008#include <ipmiblob/blob_interface.hpp>
Patrick Venture9b37b092020-05-28 20:58:57 -07009
10#include <cstdint>
Medad CChienc8445aa2020-04-23 09:47:46 +080011#include <vector>
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -070012
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -070013namespace host_tool
14{
15
16class P2aDataHandler : public DataInterface
17{
18 public:
Benjamin Faire5aafa52020-06-05 21:04:24 -070019 P2aDataHandler(ipmiblob::BlobInterface* blob, const PciAccess* pci,
20 ProgressInterface* progress,
Patrick Venture18bbe3c2019-05-14 11:40:57 -070021 const internal::Sys* sys = &internal::sys_impl) :
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -070022 blob(blob),
Benjamin Faire5aafa52020-06-05 21:04:24 -070023 pci(pci), progress(progress), sys(sys)
Patrick Venture9b37b092020-05-28 20:58:57 -070024 {}
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -070025
26 bool sendContents(const std::string& input, std::uint16_t session) override;
Patrick Venture84778b82019-06-26 20:11:09 -070027 ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const override
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -070028 {
Patrick Venture84778b82019-06-26 20:11:09 -070029 return ipmi_flash::FirmwareFlags::UpdateFlags::p2a;
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -070030 }
31
32 private:
33 ipmiblob::BlobInterface* blob;
Benjamin Faire5aafa52020-06-05 21:04:24 -070034 const PciAccess* pci;
Patrick Venturecf9b2192019-06-27 12:09:52 -070035 ProgressInterface* progress;
Patrick Venture18bbe3c2019-05-14 11:40:57 -070036 const internal::Sys* sys;
Medad CChienc8445aa2020-04-23 09:47:46 +080037};
Benjamin Faire5aafa52020-06-05 21:04:24 -070038
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -070039} // namespace host_tool