blob: 3eda7cb611e8c96f002e1bf570dd89a88f722d5a [file] [log] [blame]
Deepak Kodihalli557dfb02019-05-12 13:11:17 +05301#pragma once
2
Sampa Misraa2fa0702019-05-31 01:28:55 -05003#include "config.h"
4
George Liu6492f522020-06-16 10:34:05 +08005#include "libpldm/platform.h"
6#include "libpldm/states.h"
George Liuc4ea6a92020-07-14 15:48:44 +08007#include "pdr.h"
George Liu6492f522020-06-16 10:34:05 +08008
Deepak Kodihallid130e1a2020-06-17 05:55:32 -05009#include "common/utils.hpp"
TOM JOSEPHd4d97a52020-03-23 14:36:34 +053010#include "event_parser.hpp"
Tom Joseph33e9c7e2020-06-11 22:09:52 +053011#include "fru.hpp"
George Liucae18662020-05-15 09:32:57 +080012#include "host-bmc/dbus_to_event_handler.hpp"
Deepak Kodihalliac19bd62020-06-16 08:25:23 -050013#include "host-bmc/host_pdr_handler.hpp"
Sampa Misraa2fa0702019-05-31 01:28:55 -050014#include "libpldmresponder/pdr.hpp"
George Liue53193f2020-02-24 09:23:26 +080015#include "libpldmresponder/pdr_utils.hpp"
Deepak Kodihalli1521f6d2020-06-16 08:51:02 -050016#include "pldmd/handler.hpp"
Sampa Misraa2fa0702019-05-31 01:28:55 -050017
Deepak Kodihalli557dfb02019-05-12 13:11:17 +053018#include <stdint.h>
19
Sampa Misraa2fa0702019-05-31 01:28:55 -050020#include <map>
Deepak Kodihalli557dfb02019-05-12 13:11:17 +053021
Deepak Kodihalli557dfb02019-05-12 13:11:17 +053022namespace pldm
23{
Deepak Kodihalli557dfb02019-05-12 13:11:17 +053024namespace responder
25{
Sampa Misraa2fa0702019-05-31 01:28:55 -050026namespace platform
27{
28
George Liu1ec85d42020-02-12 16:05:32 +080029using namespace pldm::utils;
30using namespace pldm::responder::pdr_utils;
George Liucae18662020-05-15 09:32:57 +080031using namespace pldm::state_sensor;
George Liu1ec85d42020-02-12 16:05:32 +080032
George Liua2870722020-02-11 11:09:30 +080033using generatePDR =
George Liu36e81352020-07-01 14:40:30 +080034 std::function<void(const pldm::utils::DBusHandler& dBusIntf,
35 const Json& json, pdr_utils::RepoInterface& repo)>;
George Liua2870722020-02-11 11:09:30 +080036
George Liu1ec85d42020-02-12 16:05:32 +080037using EffecterId = uint16_t;
George Liua2870722020-02-11 11:09:30 +080038using DbusObjMaps =
39 std::map<EffecterId,
40 std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps>>;
Tom Joseph56e45c52020-03-16 10:01:45 +053041using DbusPath = std::string;
42using EffecterObjs = std::vector<DbusPath>;
43using EventType = uint8_t;
44using EventHandler = std::function<int(
45 const pldm_msg* request, size_t payloadLength, uint8_t formatVersion,
46 uint8_t tid, size_t eventDataOffset)>;
47using EventHandlers = std::vector<EventHandler>;
48using EventMap = std::map<EventType, EventHandlers>;
George Liuc4ea6a92020-07-14 15:48:44 +080049using AssociatedEntityMap = std::map<DbusPath, pldm_entity>;
Deepak Kodihallic682fe22020-03-04 00:42:54 -060050
Deepak Kodihallibc669f12019-11-28 08:52:07 -060051class Handler : public CmdHandler
Sampa Misraa2fa0702019-05-31 01:28:55 -050052{
Deepak Kodihallibc669f12019-11-28 08:52:07 -060053 public:
Deepak Kodihallib5c227e2020-07-13 06:58:34 -050054 Handler(const pldm::utils::DBusHandler* dBusIntf,
George Liu36e81352020-07-01 14:40:30 +080055 const std::string& pdrJsonsDir, const std::string& eventsJsonsDir,
TOM JOSEPHd4d97a52020-03-23 14:36:34 +053056 pldm_pdr* repo, HostPDRHandler* hostPDRHandler,
George Liucae18662020-05-15 09:32:57 +080057 DbusToPLDMEvent* dbusToPLDMEventHandler, fru::Handler* fruHandler,
58 bool buildPDRLazily = false,
Tom Joseph56e45c52020-03-16 10:01:45 +053059 const std::optional<EventMap>& addOnHandlersMap = std::nullopt) :
Pavithra Barithaya51efaf82020-04-02 02:42:27 -050060 pdrRepo(repo),
Tom Joseph33e9c7e2020-06-11 22:09:52 +053061 hostPDRHandler(hostPDRHandler), stateSensorHandler(eventsJsonsDir),
George Liucae18662020-05-15 09:32:57 +080062 dbusToPLDMEventHandler(dbusToPLDMEventHandler), fruHandler(fruHandler),
63 dBusIntf(dBusIntf), pdrJsonsDir(pdrJsonsDir), pdrCreated(false)
Sampa Misraa2fa0702019-05-31 01:28:55 -050064 {
Deepak Kodihallib5c227e2020-07-13 06:58:34 -050065 if (!buildPDRLazily)
66 {
Sampa Misra12afe112020-05-25 11:40:44 -050067 generateTerminusLocatorPDR(pdrRepo);
Deepak Kodihallib5c227e2020-07-13 06:58:34 -050068 generate(*dBusIntf, pdrJsonsDir, pdrRepo);
69 pdrCreated = true;
70 }
Deepak Kodihallic682fe22020-03-04 00:42:54 -060071
Deepak Kodihallibc669f12019-11-28 08:52:07 -060072 handlers.emplace(PLDM_GET_PDR,
73 [this](const pldm_msg* request, size_t payloadLength) {
74 return this->getPDR(request, payloadLength);
75 });
George Liueccb0c52020-01-14 11:09:56 +080076 handlers.emplace(PLDM_SET_NUMERIC_EFFECTER_VALUE,
77 [this](const pldm_msg* request, size_t payloadLength) {
78 return this->setNumericEffecterValue(
79 request, payloadLength);
80 });
Deepak Kodihallibc669f12019-11-28 08:52:07 -060081 handlers.emplace(PLDM_SET_STATE_EFFECTER_STATES,
82 [this](const pldm_msg* request, size_t payloadLength) {
83 return this->setStateEffecterStates(request,
84 payloadLength);
85 });
Tom Joseph56e45c52020-03-16 10:01:45 +053086 handlers.emplace(PLDM_PLATFORM_EVENT_MESSAGE,
87 [this](const pldm_msg* request, size_t payloadLength) {
88 return this->platformEventMessage(request,
89 payloadLength);
90 });
George Liu362c18d2020-05-14 09:46:36 +080091 handlers.emplace(PLDM_GET_STATE_SENSOR_READINGS,
92 [this](const pldm_msg* request, size_t payloadLength) {
93 return this->getStateSensorReadings(request,
94 payloadLength);
95 });
Tom Joseph56e45c52020-03-16 10:01:45 +053096
97 // Default handler for PLDM Events
98 eventHandlers[PLDM_SENSOR_EVENT].emplace_back(
99 [this](const pldm_msg* request, size_t payloadLength,
100 uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
101 return this->sensorEvent(request, payloadLength, formatVersion,
102 tid, eventDataOffset);
103 });
Deepak Kodihalli8cb6f662020-04-10 02:55:43 -0500104 eventHandlers[PLDM_PDR_REPOSITORY_CHG_EVENT].emplace_back(
105 [this](const pldm_msg* request, size_t payloadLength,
106 uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
107 return this->pldmPDRRepositoryChgEvent(request, payloadLength,
108 formatVersion, tid,
109 eventDataOffset);
110 });
Tom Joseph56e45c52020-03-16 10:01:45 +0530111
112 // Additional OEM event handlers for PLDM events, append it to the
113 // standard handlers
114 if (addOnHandlersMap)
115 {
116 auto addOnHandlers = addOnHandlersMap.value();
117 for (EventMap::iterator iter = addOnHandlers.begin();
118 iter != addOnHandlers.end(); ++iter)
119 {
120 auto search = eventHandlers.find(iter->first);
121 if (search != eventHandlers.end())
122 {
123 search->second.insert(std::end(search->second),
124 std::begin(iter->second),
125 std::end(iter->second));
126 }
127 else
128 {
129 eventHandlers.emplace(iter->first, iter->second);
130 }
131 }
132 }
Sampa Misraa2fa0702019-05-31 01:28:55 -0500133 }
134
George Liu1ec85d42020-02-12 16:05:32 +0800135 pdr_utils::Repo& getRepo()
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600136 {
George Liu1ec85d42020-02-12 16:05:32 +0800137 return this->pdrRepo;
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600138 }
139
George Liu1ec85d42020-02-12 16:05:32 +0800140 /** @brief Add D-Bus mapping and value mapping(stateId to D-Bus) for the
George Liuadbe1722020-05-09 19:20:19 +0800141 * Id. If the same id is added, the previous dbusObjs will
George Liu1ec85d42020-02-12 16:05:32 +0800142 * be "over-written".
143 *
George Liuadbe1722020-05-09 19:20:19 +0800144 * @param[in] Id - effecter/sensor id
George Liu1ec85d42020-02-12 16:05:32 +0800145 * @param[in] dbusObj - list of D-Bus object structure and list of D-Bus
146 * property value to attribute value
George Liuadbe1722020-05-09 19:20:19 +0800147 * @param[in] typeId - the type id of enum
George Liu1ec85d42020-02-12 16:05:32 +0800148 */
George Liua2870722020-02-11 11:09:30 +0800149 void addDbusObjMaps(
George Liuadbe1722020-05-09 19:20:19 +0800150 uint16_t id,
151 std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps> dbusObj,
152 TypeId typeId = TypeId::PLDM_EFFECTER_ID);
George Liu1ec85d42020-02-12 16:05:32 +0800153
George Liuadbe1722020-05-09 19:20:19 +0800154 /** @brief Retrieve an id -> D-Bus objects mapping
George Liu1ec85d42020-02-12 16:05:32 +0800155 *
George Liuadbe1722020-05-09 19:20:19 +0800156 * @param[in] Id - id
157 * @param[in] typeId - the type id of enum
George Liu1ec85d42020-02-12 16:05:32 +0800158 *
George Liua2870722020-02-11 11:09:30 +0800159 * @return std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps> -
160 * list of D-Bus object structure and list of D-Bus property value
161 * to attribute value
George Liu1ec85d42020-02-12 16:05:32 +0800162 */
George Liua2870722020-02-11 11:09:30 +0800163 const std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps>&
George Liuadbe1722020-05-09 19:20:19 +0800164 getDbusObjMaps(uint16_t id,
165 TypeId typeId = TypeId::PLDM_EFFECTER_ID) const;
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600166
167 uint16_t getNextEffecterId()
168 {
169 return ++nextEffecterId;
170 }
171
George Liuadbe1722020-05-09 19:20:19 +0800172 uint16_t getNextSensorId()
173 {
174 return ++nextSensorId;
175 }
176
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600177 /** @brief Parse PDR JSONs and build PDR repository
178 *
George Liu36e81352020-07-01 14:40:30 +0800179 * @param[in] dBusIntf - The interface object
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600180 * @param[in] dir - directory housing platform specific PDR JSON files
181 * @param[in] repo - instance of concrete implementation of Repo
182 */
George Liu36e81352020-07-01 14:40:30 +0800183 void generate(const pldm::utils::DBusHandler& dBusIntf,
184 const std::string& dir, Repo& repo);
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600185
186 /** @brief Parse PDR JSONs and build state effecter PDR repository
187 *
188 * @param[in] json - platform specific PDR JSON files
189 * @param[in] repo - instance of state effecter implementation of Repo
190 */
191 void generateStateEffecterRepo(const Json& json, Repo& repo);
192
Tom Joseph56e45c52020-03-16 10:01:45 +0530193 /** @brief map of PLDM event type to EventHandlers
194 *
195 */
196 EventMap eventHandlers;
197
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600198 /** @brief Handler for GetPDR
199 *
200 * @param[in] request - Request message payload
201 * @param[in] payloadLength - Request payload length
202 * @param[out] Response - Response message written here
203 */
204 Response getPDR(const pldm_msg* request, size_t payloadLength);
Sampa Misraa2fa0702019-05-31 01:28:55 -0500205
George Liueccb0c52020-01-14 11:09:56 +0800206 /** @brief Handler for setNumericEffecterValue
207 *
208 * @param[in] request - Request message
209 * @param[in] payloadLength - Request payload length
210 * @return Response - PLDM Response message
211 */
212 Response setNumericEffecterValue(const pldm_msg* request,
213 size_t payloadLength);
214
George Liu362c18d2020-05-14 09:46:36 +0800215 /** @brief Handler for getStateSensorReadings
216 *
217 * @param[in] request - Request message
218 * @param[in] payloadLength - Request payload length
219 * @return Response - PLDM Response message
220 */
221 Response getStateSensorReadings(const pldm_msg* request,
222 size_t payloadLength);
223
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600224 /** @brief Handler for setStateEffecterStates
225 *
226 * @param[in] request - Request message
227 * @param[in] payloadLength - Request payload length
228 * @return Response - PLDM Response message
229 */
230 Response setStateEffecterStates(const pldm_msg* request,
231 size_t payloadLength);
232
Tom Joseph56e45c52020-03-16 10:01:45 +0530233 /** @brief Handler for PlatformEventMessage
234 *
235 * @param[in] request - Request message
236 * @param[in] payloadLength - Request payload length
237 * @return Response - PLDM Response message
238 */
239 Response platformEventMessage(const pldm_msg* request,
240 size_t payloadLength);
241
242 /** @brief Handler for event class Sensor event
243 *
244 * @param[in] request - Request message
245 * @param[in] payloadLength - Request payload length
246 * @param[in] formatVersion - Version of the event format
247 * @param[in] tid - Terminus ID of the event's originator
248 * @param[in] eventDataOffset - Offset of the event data in the request
249 * message
250 * @return PLDM completion code
251 */
252 int sensorEvent(const pldm_msg* request, size_t payloadLength,
253 uint8_t formatVersion, uint8_t tid, size_t eventDataOffset);
254
Deepak Kodihalli8cb6f662020-04-10 02:55:43 -0500255 /** @brief Handler for pldmPDRRepositoryChgEvent
256 *
257 * @param[in] request - Request message
258 * @param[in] payloadLength - Request payload length
259 * @param[in] formatVersion - Version of the event format
260 * @param[in] tid - Terminus ID of the event's originator
261 * @param[in] eventDataOffset - Offset of the event data in the request
262 * message
263 * @return PLDM completion code
264 */
265 int pldmPDRRepositoryChgEvent(const pldm_msg* request, size_t payloadLength,
266 uint8_t formatVersion, uint8_t tid,
267 size_t eventDataOffset);
268
269 /** @brief Handler for extracting the PDR handles from changeEntries
270 *
271 * @param[in] changeEntryData - ChangeEntry data from changeRecord
272 * @param[in] changeEntryDataSize - total size of changeEntryData
273 * @param[in] numberOfChangeEntries - total number of changeEntries to
274 * extract
275 * @param[out] pdrRecordHandles - std::vector where the extracted PDR
276 * handles are placed
277 * @return PLDM completion code
278 */
279 int getPDRRecordHandles(const ChangeEntry* changeEntryData,
280 size_t changeEntryDataSize,
281 size_t numberOfChangeEntries,
282 PDRRecordHandles& pdrRecordHandles);
283
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600284 /** @brief Function to set the effecter requested by pldm requester
285 * @param[in] dBusIntf - The interface object
286 * @param[in] effecterId - Effecter ID sent by the requester to act on
287 * @param[in] stateField - The state field data for each of the states,
288 * equal to composite effecter count in number
289 * @return - Success or failure in setting the states. Returns failure in
290 * terms of PLDM completion codes if atleast one state fails to be set
291 */
292 template <class DBusInterface>
293 int setStateEffecterStatesHandler(
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600294 const DBusInterface& dBusIntf, uint16_t effecterId,
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600295 const std::vector<set_effecter_state_field>& stateField)
Sampa Misraa2fa0702019-05-31 01:28:55 -0500296 {
George Liue53193f2020-02-24 09:23:26 +0800297 using namespace pldm::responder::pdr;
George Liu1e44c732020-02-28 20:20:06 +0800298 using namespace pldm::utils;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600299 using StateSetNum = uint8_t;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600300
301 state_effecter_possible_states* states = nullptr;
302 pldm_state_effecter_pdr* pdr = nullptr;
303 uint8_t compEffecterCnt = stateField.size();
George Liu1ec85d42020-02-12 16:05:32 +0800304
305 std::unique_ptr<pldm_pdr, decltype(&pldm_pdr_destroy)>
306 stateEffecterPdrRepo(pldm_pdr_init(), pldm_pdr_destroy);
307 Repo stateEffecterPDRs(stateEffecterPdrRepo.get());
308 getRepoByType(pdrRepo, stateEffecterPDRs, PLDM_STATE_EFFECTER_PDR);
309 if (stateEffecterPDRs.empty())
310 {
311 std::cerr << "Failed to get record by PDR type\n";
312 return PLDM_PLATFORM_INVALID_EFFECTER_ID;
313 }
314
George Liue53193f2020-02-24 09:23:26 +0800315 PdrEntry pdrEntry{};
George Liu1ec85d42020-02-12 16:05:32 +0800316 auto pdrRecord = stateEffecterPDRs.getFirstRecord(pdrEntry);
George Liue53193f2020-02-24 09:23:26 +0800317 while (pdrRecord)
318 {
319 pdr = reinterpret_cast<pldm_state_effecter_pdr*>(pdrEntry.data);
320 if (pdr->effecter_id != effecterId)
Sampa Misraa2fa0702019-05-31 01:28:55 -0500321 {
George Liue53193f2020-02-24 09:23:26 +0800322 pdr = nullptr;
George Liu1ec85d42020-02-12 16:05:32 +0800323 pdrRecord =
324 stateEffecterPDRs.getNextRecord(pdrRecord, pdrEntry);
George Liue53193f2020-02-24 09:23:26 +0800325 continue;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600326 }
George Liue53193f2020-02-24 09:23:26 +0800327
328 states = reinterpret_cast<state_effecter_possible_states*>(
329 pdr->possible_states);
330 if (compEffecterCnt > pdr->composite_effecter_count)
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600331 {
George Liue53193f2020-02-24 09:23:26 +0800332 std::cerr << "The requester sent wrong composite effecter"
333 << " count for the effecter, EFFECTER_ID="
334 << effecterId << "COMP_EFF_CNT=" << compEffecterCnt
335 << "\n";
336 return PLDM_ERROR_INVALID_DATA;
Sampa Misraa2fa0702019-05-31 01:28:55 -0500337 }
George Liue53193f2020-02-24 09:23:26 +0800338 break;
339 }
340
341 if (!pdr)
342 {
343 return PLDM_PLATFORM_INVALID_EFFECTER_ID;
Sampa Misraa2fa0702019-05-31 01:28:55 -0500344 }
Sampa Misraa2fa0702019-05-31 01:28:55 -0500345
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600346 int rc = PLDM_SUCCESS;
George Liu1ec85d42020-02-12 16:05:32 +0800347 try
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600348 {
George Liu1ec85d42020-02-12 16:05:32 +0800349 const auto& [dbusMappings, dbusValMaps] =
George Liuadbe1722020-05-09 19:20:19 +0800350 effecterDbusObjMaps.at(effecterId);
George Liu1ec85d42020-02-12 16:05:32 +0800351 for (uint8_t currState = 0; currState < compEffecterCnt;
352 ++currState)
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600353 {
George Liu1ec85d42020-02-12 16:05:32 +0800354 std::vector<StateSetNum> allowed{};
355 // computation is based on table 79 from DSP0248 v1.1.1
356 uint8_t bitfieldIndex =
357 stateField[currState].effecter_state / 8;
358 uint8_t bit =
359 stateField[currState].effecter_state - (8 * bitfieldIndex);
360 if (states->possible_states_size < bitfieldIndex ||
361 !(states->states[bitfieldIndex].byte & (1 << bit)))
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600362 {
George Liu1ec85d42020-02-12 16:05:32 +0800363 std::cerr
364 << "Invalid state set value, EFFECTER_ID=" << effecterId
365 << " VALUE=" << stateField[currState].effecter_state
366 << " COMPOSITE_EFFECTER_ID=" << currState
367 << " DBUS_PATH=" << dbusMappings[currState].objectPath
368 << "\n";
369 rc = PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600370 break;
371 }
George Liu1ec85d42020-02-12 16:05:32 +0800372 const DBusMapping& dbusMapping = dbusMappings[currState];
373 const StatestoDbusVal& dbusValToMap = dbusValMaps[currState];
374
375 if (stateField[currState].set_request == PLDM_REQUEST_SET)
376 {
377 try
378 {
379 dBusIntf.setDbusProperty(
380 dbusMapping,
381 dbusValToMap.at(
382 stateField[currState].effecter_state));
383 }
384 catch (const std::exception& e)
385 {
386 std::cerr
387 << "Error setting property, ERROR=" << e.what()
388 << " PROPERTY=" << dbusMapping.propertyName
389 << " INTERFACE="
390 << dbusMapping.interface << " PATH="
391 << dbusMapping.objectPath << "\n";
392 return PLDM_ERROR;
393 }
394 }
395 uint8_t* nextState =
396 reinterpret_cast<uint8_t*>(states) +
397 sizeof(state_effecter_possible_states) -
398 sizeof(states->states) +
399 (states->possible_states_size * sizeof(states->states));
400 states = reinterpret_cast<state_effecter_possible_states*>(
401 nextState);
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600402 }
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600403 }
George Liu1ec85d42020-02-12 16:05:32 +0800404 catch (const std::out_of_range& e)
405 {
406 std::cerr << "the effecterId does not exist. effecter id: "
407 << effecterId << e.what() << '\n';
408 }
409
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600410 return rc;
411 }
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600412
Sampa Misra12afe112020-05-25 11:40:44 -0500413 /** @brief Build BMC Terminus Locator PDR
414 *
415 * @param[in] repo - instance of concrete implementation of Repo
416 */
417 void generateTerminusLocatorPDR(Repo& repo);
418
George Liuc4ea6a92020-07-14 15:48:44 +0800419 /** @brief Get std::map associated with the entity
420 * key: object path
421 * value: pldm_entity
422 *
423 * @return std::map<ObjectPath, pldm_entity>
424 */
425 inline const AssociatedEntityMap& getAssociateEntityMap() const
426 {
427 if (fruHandler == nullptr)
428 {
429 throw InternalFailure();
430 }
431 return fruHandler->getAssociateEntityMap();
432 }
433
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600434 private:
435 pdr_utils::Repo pdrRepo;
436 uint16_t nextEffecterId{};
George Liuadbe1722020-05-09 19:20:19 +0800437 uint16_t nextSensorId{};
438 DbusObjMaps effecterDbusObjMaps{};
439 DbusObjMaps sensorDbusObjMaps{};
Pavithra Barithaya51efaf82020-04-02 02:42:27 -0500440 HostPDRHandler* hostPDRHandler;
TOM JOSEPHd4d97a52020-03-23 14:36:34 +0530441 events::StateSensorHandler stateSensorHandler;
George Liucae18662020-05-15 09:32:57 +0800442 DbusToPLDMEvent* dbusToPLDMEventHandler;
Tom Joseph33e9c7e2020-06-11 22:09:52 +0530443 fru::Handler* fruHandler;
Deepak Kodihallib5c227e2020-07-13 06:58:34 -0500444 const pldm::utils::DBusHandler* dBusIntf;
445 std::string pdrJsonsDir;
446 bool pdrCreated;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600447};
448
449} // namespace platform
Deepak Kodihalli557dfb02019-05-12 13:11:17 +0530450} // namespace responder
451} // namespace pldm