xref: /openbmc/pldm/platform-mc/manager.cpp (revision 51cc5bda)
1 #include "manager.hpp"
2 
3 #include <phosphor-logging/lg2.hpp>
4 
5 PHOSPHOR_LOG2_USING;
6 
7 namespace pldm
8 {
9 namespace platform_mc
10 {
11 exec::task<int> Manager::beforeDiscoverTerminus()
12 {
13     // Add any setup or checks needed before discovering a terminus
14     // If any setup/check fails, return the appropriate error code
15     // For now, we assume everything is successful
16     co_return PLDM_SUCCESS;
17 }
18 
19 exec::task<int> Manager::afterDiscoverTerminus()
20 {
21     auto rc = co_await platformManager.initTerminus();
22     if (rc != PLDM_SUCCESS)
23     {
24         lg2::error("Failed to initialize platform manager, error {RC}", "RC",
25                    rc);
26     }
27     else
28     {
29         lg2::info("Successfully initialized platform manager");
30     }
31     co_return rc;
32 }
33 
34 } // namespace platform_mc
35 } // namespace pldm
36