blob: ba0077f989d987e411db00f12f13e6aef476de8a [file] [log] [blame]
Sampa Misraaea5dde2020-08-31 08:33:47 -05001#pragma once
2
3#include "common/types.hpp"
4#include "common/utils.hpp"
5#include "pldmd/handler.hpp"
6
7namespace pldm
8{
9
10using namespace pdr;
11
12namespace responder
13{
14
15namespace oem_platform
16{
17
18class Handler : public CmdHandler
19{
20 public:
21 Handler(const pldm::utils::DBusHandler* dBusIntf) : dBusIntf(dBusIntf)
22 {}
23
24 /** @brief Interface to get the state sensor readings requested by pldm
25 * requester for OEM types. Each specific type should implement a handler
26 * of it's own
27 *
28 * @param[in] entityType - entity type corresponding to the sensor
29 * @param[in] entityInstance - entity instance number
30 * @param[in] stateSetId - state set id
31 * @param[in] compSensorCnt - composite sensor count
32 * @param[out] stateField - The state field data for each of the states,
33 * equal to composite sensor count in number
34 *
35 * @return - Success or failure in getting the states. Returns failure in
36 * terms of PLDM completion codes if fetching atleast one state
37 * fails
38 */
39 virtual int getOemStateSensorReadingsHandler(
40 EntityType entityType, EntityInstance entityInstance,
41 StateSetId stateSetId, CompositeCount compSensorCnt,
42 std::vector<get_sensor_state_field>& stateField) = 0;
43
44 /** @brief Interface to set the effecter requested by pldm requester
45 * for OEM types. Each individual oem type should implement
46 * it's own handler.
47 *
48 * @param[in] entityType - entity type corresponding to the effecter id
49 * @param[in] entityInstance - entity instance
50 * @param[in] stateSetId - state set id
51 * @param[in] compEffecterCnt - composite effecter count
Varsha Kaverappa3fbd39e2020-09-28 01:40:22 -050052 * @param[in] stateField - The state field data for each of the states,
Sampa Misraaea5dde2020-08-31 08:33:47 -050053 * equal to compEffecterCnt in number
Varsha Kaverappa3fbd39e2020-09-28 01:40:22 -050054 * @param[in] effecterId - Effecter id
Sampa Misraaea5dde2020-08-31 08:33:47 -050055 *
56 * @return - Success or failure in setting the states.Returns failure in
57 * terms of PLDM completion codes if atleast one state fails to
58 * be set
59 */
Sampa Misra3a0e3b92020-10-21 05:58:00 -050060 virtual int oemSetStateEffecterStatesHandler(
Varsha Kaverappa3fbd39e2020-09-28 01:40:22 -050061 uint16_t entityType, uint16_t entityInstance, uint16_t stateSetId,
62 uint8_t compEffecterCnt,
63 std::vector<set_effecter_state_field>& stateField,
64 uint16_t effecterId) = 0;
Sampa Misraaea5dde2020-08-31 08:33:47 -050065
Sagar Srinivas78a225a2020-08-27 00:52:20 -050066 /** @brief Interface to generate the OEM PDRs
67 *
68 * @param[in] repo - instance of concrete implementation of Repo
69 */
70 virtual void buildOEMPDR(pdr_utils::Repo& repo) = 0;
71
Sampa Misraaea5dde2020-08-31 08:33:47 -050072 virtual ~Handler() = default;
73
74 protected:
75 const pldm::utils::DBusHandler* dBusIntf;
76};
77
78} // namespace oem_platform
79
80} // namespace responder
81
82} // namespace pldm