blob: a7fd41205c3094e4c6b9c88a9e77e443fe394fac [file] [log] [blame]
Gilbert Chen6c7fed42022-02-22 15:40:17 +00001#pragma once
2
3#include "libpldm/platform.h"
4#include "libpldm/pldm.h"
5
6#include "terminus.hpp"
7#include "terminus_manager.hpp"
8
9namespace pldm
10{
11
12namespace platform_mc
13{
14
15/**
16 * @brief PlatformManager
17 *
18 * PlatformManager class manages the actions outlined in the platform spec.
19 */
20class PlatformManager
21{
22 public:
23 PlatformManager() = delete;
24 PlatformManager(const PlatformManager&) = delete;
25 PlatformManager(PlatformManager&&) = delete;
26 PlatformManager& operator=(const PlatformManager&) = delete;
27 PlatformManager& operator=(PlatformManager&&) = delete;
28 ~PlatformManager() = default;
29
30 explicit PlatformManager(TerminusManager& terminusManager,
31 TerminiMapper& termini) :
32 terminusManager(terminusManager),
33 termini(termini)
34 {}
35
36 /** @brief Initialize terminus which supports PLDM Type 2
37 *
38 * @return coroutine return_value - PLDM completion code
39 */
40 exec::task<int> initTerminus();
41
42 private:
43 /** reference of TerminusManager for sending PLDM request to terminus*/
44 TerminusManager& terminusManager;
45
46 /** @brief Managed termini list */
47 TerminiMapper& termini;
48};
49} // namespace platform_mc
50} // namespace pldm