blob: 0f3b24ed5eddef50965e37b8085ad73c280250ad [file] [log] [blame]
Alexander Hansen8d9e6da2025-01-14 14:17:19 +01001#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
16class 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
27const std::string exampleConfigObjPath =
28 "/xyz/openbmc_project/inventory/system/board/Tyan_S5549_Baseboard/HostSPIFlash";
29const std::string exampleName = "HostSPIFlash";
30
31const uint32_t exampleVendorIANA = 0x0000a015;
32const std::string exampleCompatible = "com.example.compatible";
33
34class 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};