Alexander Hansen | 8d9e6da | 2025-01-14 14:17:19 +0100 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include "common/include/device.hpp" |
| 4 | #include "common/include/software_manager.hpp" |
| 5 | |
| 6 | #include <phosphor-logging/lg2.hpp> |
| 7 | #include <sdbusplus/asio/connection.hpp> |
| 8 | #include <sdbusplus/asio/object_server.hpp> |
| 9 | #include <sdbusplus/async.hpp> |
| 10 | #include <sdbusplus/server.hpp> |
| 11 | #include <xyz/openbmc_project/Association/Definitions/server.hpp> |
| 12 | #include <xyz/openbmc_project/Software/Update/server.hpp> |
| 13 | |
| 14 | #include <memory> |
| 15 | |
| 16 | class NopCodeUpdater : public SoftwareManager |
| 17 | { |
| 18 | public: |
| 19 | NopCodeUpdater(sdbusplus::async::context& ctx); |
| 20 | NopCodeUpdater(sdbusplus::async::context& ctx, long uniqueSuffix); |
| 21 | |
| 22 | sdbusplus::async::task<> getInitialConfigurationSingleDevice( |
| 23 | const std::string& service, const std::string& path, |
| 24 | DeviceConfig& config) final; |
| 25 | }; |
| 26 | |
| 27 | const std::string exampleConfigObjPath = |
| 28 | "/xyz/openbmc_project/inventory/system/board/Tyan_S5549_Baseboard/HostSPIFlash"; |
| 29 | const std::string exampleName = "HostSPIFlash"; |
| 30 | |
| 31 | const uint32_t exampleVendorIANA = 0x0000a015; |
| 32 | const std::string exampleCompatible = "com.example.compatible"; |
| 33 | |
| 34 | class NopDevice : public Device |
| 35 | { |
| 36 | public: |
| 37 | NopDevice(sdbusplus::async::context& ctx, const DeviceConfig& config, |
| 38 | SoftwareManager* parent); |
| 39 | NopDevice(sdbusplus::async::context& ctx, SoftwareManager* parent); |
| 40 | |
| 41 | // NOLINTBEGIN |
| 42 | sdbusplus::async::task<bool> updateDevice( |
| 43 | const uint8_t* image, size_t image_size, |
| 44 | std::unique_ptr<SoftwareActivationProgress>& activationProgress) |
| 45 | override; |
| 46 | // NOLINTEND |
| 47 | |
| 48 | sdbusplus::async::task<std::string> getInventoryItemObjectPath() override; |
| 49 | |
| 50 | bool deviceSpecificUpdateFunctionCalled = false; |
| 51 | }; |