blob: ae57582afe68d1beb689af7f45d12ee140d33ef5 [file] [log] [blame]
Christopher Meis26fbbd52025-03-26 14:55:06 +01001#pragma once
2
Christopher Meisfc9e7fd2025-04-03 13:13:35 +02003#include "../utils.hpp"
Christopher Meis26fbbd52025-03-26 14:55:06 +01004
5#include <systemd/sd-journal.h>
6
7#include <boost/container/flat_map.hpp>
8#include <nlohmann/json.hpp>
9#include <sdbusplus/asio/object_server.hpp>
10
11#include <functional>
12#include <list>
13#include <vector>
14
15namespace scan
16{
17struct DBusDeviceDescriptor
18{
19 DBusInterface interface;
20 std::string path;
21};
22
23using FoundDevices = std::vector<DBusDeviceDescriptor>;
24
25struct PerformScan : std::enable_shared_from_this<PerformScan>
26{
27 PerformScan(nlohmann::json& systemConfiguration,
28 nlohmann::json& missingConfigurations,
29 std::list<nlohmann::json>& configurations,
30 sdbusplus::asio::object_server& objServer,
31 std::function<void()>&& callback);
32
33 void updateSystemConfiguration(const nlohmann::json& recordRef,
34 const std::string& probeName,
35 FoundDevices& foundDevices);
36 void run();
37 virtual ~PerformScan();
38 nlohmann::json& _systemConfiguration;
39 nlohmann::json& _missingConfigurations;
40 std::list<nlohmann::json> _configurations;
41 sdbusplus::asio::object_server& objServer;
42 std::function<void()> _callback;
43 bool _passed = false;
44 MapperGetSubTreeResponse dbusProbeObjects;
45 std::vector<std::string> passedProbes;
46};
47
48} // namespace scan