Tom Joseph | fb3bc06 | 2021-08-17 07:48:11 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "fw-update/manager.hpp" |
| 4 | |
| 5 | #include <sdbusplus/bus/match.hpp> |
| 6 | |
| 7 | namespace pldm |
| 8 | { |
| 9 | |
Riya Dixit | 754041d | 2024-02-20 06:15:49 -0600 | [diff] [blame^] | 10 | constexpr auto MCTPService = "xyz.openbmc_project.MCTP"; |
| 11 | constexpr auto MCTPPath = "/xyz/openbmc_project/mctp"; |
| 12 | |
Tom Joseph | fb3bc06 | 2021-08-17 07:48:11 -0700 | [diff] [blame] | 13 | class MctpDiscovery |
| 14 | { |
| 15 | public: |
| 16 | MctpDiscovery() = delete; |
| 17 | MctpDiscovery(const MctpDiscovery&) = delete; |
| 18 | MctpDiscovery(MctpDiscovery&&) = delete; |
| 19 | MctpDiscovery& operator=(const MctpDiscovery&) = delete; |
| 20 | MctpDiscovery& operator=(MctpDiscovery&&) = delete; |
| 21 | ~MctpDiscovery() = default; |
| 22 | |
| 23 | /** @brief Constructs the MCTP Discovery object to handle discovery of |
| 24 | * MCTP enabled devices |
| 25 | * |
| 26 | * @param[in] bus - reference to systemd bus |
| 27 | * @param[in] fwManager - pointer to the firmware manager |
| 28 | */ |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 29 | explicit MctpDiscovery(sdbusplus::bus_t& bus, |
Tom Joseph | fb3bc06 | 2021-08-17 07:48:11 -0700 | [diff] [blame] | 30 | fw_update::Manager* fwManager); |
| 31 | |
| 32 | private: |
| 33 | /** @brief reference to the systemd bus */ |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 34 | sdbusplus::bus_t& bus; |
Tom Joseph | fb3bc06 | 2021-08-17 07:48:11 -0700 | [diff] [blame] | 35 | |
| 36 | fw_update::Manager* fwManager; |
| 37 | |
| 38 | /** @brief Used to watch for new MCTP endpoints */ |
| 39 | sdbusplus::bus::match_t mctpEndpointSignal; |
| 40 | |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 41 | void dicoverEndpoints(sdbusplus::message_t& msg); |
Tom Joseph | fb3bc06 | 2021-08-17 07:48:11 -0700 | [diff] [blame] | 42 | |
| 43 | static constexpr uint8_t mctpTypePLDM = 1; |
| 44 | |
| 45 | static constexpr std::string_view mctpEndpointIntfName{ |
| 46 | "xyz.openbmc_project.MCTP.Endpoint"}; |
| 47 | }; |
| 48 | |
Patrick Williams | 6da4f91 | 2023-05-10 07:50:53 -0500 | [diff] [blame] | 49 | } // namespace pldm |