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 | |
| 10 | class MctpDiscovery |
| 11 | { |
| 12 | public: |
| 13 | MctpDiscovery() = delete; |
| 14 | MctpDiscovery(const MctpDiscovery&) = delete; |
| 15 | MctpDiscovery(MctpDiscovery&&) = delete; |
| 16 | MctpDiscovery& operator=(const MctpDiscovery&) = delete; |
| 17 | MctpDiscovery& operator=(MctpDiscovery&&) = delete; |
| 18 | ~MctpDiscovery() = default; |
| 19 | |
| 20 | /** @brief Constructs the MCTP Discovery object to handle discovery of |
| 21 | * MCTP enabled devices |
| 22 | * |
| 23 | * @param[in] bus - reference to systemd bus |
| 24 | * @param[in] fwManager - pointer to the firmware manager |
| 25 | */ |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 26 | explicit MctpDiscovery(sdbusplus::bus_t& bus, |
Tom Joseph | fb3bc06 | 2021-08-17 07:48:11 -0700 | [diff] [blame] | 27 | fw_update::Manager* fwManager); |
| 28 | |
| 29 | private: |
| 30 | /** @brief reference to the systemd bus */ |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 31 | sdbusplus::bus_t& bus; |
Tom Joseph | fb3bc06 | 2021-08-17 07:48:11 -0700 | [diff] [blame] | 32 | |
| 33 | fw_update::Manager* fwManager; |
| 34 | |
| 35 | /** @brief Used to watch for new MCTP endpoints */ |
| 36 | sdbusplus::bus::match_t mctpEndpointSignal; |
| 37 | |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 38 | void dicoverEndpoints(sdbusplus::message_t& msg); |
Tom Joseph | fb3bc06 | 2021-08-17 07:48:11 -0700 | [diff] [blame] | 39 | |
| 40 | static constexpr uint8_t mctpTypePLDM = 1; |
| 41 | |
| 42 | static constexpr std::string_view mctpEndpointIntfName{ |
| 43 | "xyz.openbmc_project.MCTP.Endpoint"}; |
| 44 | }; |
| 45 | |
| 46 | } // namespace pldm |