platform-mc: Added Terminus/TerminusManager class
Added requester::sendRecvPldmMsg awaiter type to be able to send and
receive PLDM message by coroutine.
Added TerminusManager to discover terminus from EID list updated by
MCTPDiscovery class. The TerminusManager will initialize TID.
Signed-off-by: Gilbert Chen <gilbert.chen@arm.com>
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Change-Id: Ifa5bdfff50648f1d7fba8710e160de662e8f9e06
diff --git a/platform-mc/platform_manager.hpp b/platform-mc/platform_manager.hpp
new file mode 100644
index 0000000..a7fd412
--- /dev/null
+++ b/platform-mc/platform_manager.hpp
@@ -0,0 +1,50 @@
+#pragma once
+
+#include "libpldm/platform.h"
+#include "libpldm/pldm.h"
+
+#include "terminus.hpp"
+#include "terminus_manager.hpp"
+
+namespace pldm
+{
+
+namespace platform_mc
+{
+
+/**
+ * @brief PlatformManager
+ *
+ * PlatformManager class manages the actions outlined in the platform spec.
+ */
+class PlatformManager
+{
+ public:
+ PlatformManager() = delete;
+ PlatformManager(const PlatformManager&) = delete;
+ PlatformManager(PlatformManager&&) = delete;
+ PlatformManager& operator=(const PlatformManager&) = delete;
+ PlatformManager& operator=(PlatformManager&&) = delete;
+ ~PlatformManager() = default;
+
+ explicit PlatformManager(TerminusManager& terminusManager,
+ TerminiMapper& termini) :
+ terminusManager(terminusManager),
+ termini(termini)
+ {}
+
+ /** @brief Initialize terminus which supports PLDM Type 2
+ *
+ * @return coroutine return_value - PLDM completion code
+ */
+ exec::task<int> initTerminus();
+
+ private:
+ /** reference of TerminusManager for sending PLDM request to terminus*/
+ TerminusManager& terminusManager;
+
+ /** @brief Managed termini list */
+ TerminiMapper& termini;
+};
+} // namespace platform_mc
+} // namespace pldm