#pragma once #include "common/include/device.hpp" #include "common/include/software_manager.hpp" #include "cpld_interface.hpp" #include #include PHOSPHOR_LOG2_USING; namespace ManagerInf = phosphor::software::manager; namespace phosphor::software::cpld { class CPLDDevice : public Device { public: CPLDDevice(sdbusplus::async::context& ctx, const std::string& chiptype, const std::string& chipname, const uint16_t& bus, const uint8_t& address, SoftwareConfig& config, ManagerInf::SoftwareManager* parent) : Device(ctx, config, parent, {RequestedApplyTimes::Immediate, RequestedApplyTimes::OnReset}), cpldInterface(CPLDFactory::instance().create(chiptype, ctx, chipname, bus, address)) {} using Device::softwareCurrent; sdbusplus::async::task updateDevice(const uint8_t* image, size_t image_size) final; sdbusplus::async::task getVersion(std::string& version); private: std::unique_ptr cpldInterface; }; } // namespace phosphor::software::cpld