blob: 52d0027f0ef8535a31add8771b149850c27789b3 [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
52 * param[in] stateField - The state field data for each of the states,
53 * equal to compEffecterCnt in number
54 *
55 * @return - Success or failure in setting the states.Returns failure in
56 * terms of PLDM completion codes if atleast one state fails to
57 * be set
58 */
59
60 virtual int oemSetStateEffecterStatesHandler(
61 EntityType entityType, EntityInstance entityInstance,
62 StateSetId stateSetId, CompositeCount compEffecterCnt,
63 const std::vector<set_effecter_state_field>& stateField) = 0;
64
65 virtual ~Handler() = default;
66
67 protected:
68 const pldm::utils::DBusHandler* dBusIntf;
69};
70
71} // namespace oem_platform
72
73} // namespace responder
74
75} // namespace pldm