blob: a4d39915fe314041fd918f30b60f1ba5e660306c [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 Liucae18662020-05-15 09:32:57 +08005#include "libpldm/pdr.h"
George Liu6492f522020-06-16 10:34:05 +08006#include "libpldm/platform.h"
7#include "libpldm/states.h"
8
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>;
Deepak Kodihallic682fe22020-03-04 00:42:54 -060049
Zahed Hossain75330f32020-03-24 02:15:03 -050050// EventEntry = <uint8_t> - EventState <uint8_t> - SensorOffset <uint16_t> -
51// SensorID
52using EventEntry = uint32_t;
53struct DBusInfo
54{
55 pldm::utils::DBusMapping dBusValues;
56 pldm::utils::PropertyValue dBusPropertyValue;
57};
58
Deepak Kodihallibc669f12019-11-28 08:52:07 -060059class Handler : public CmdHandler
Sampa Misraa2fa0702019-05-31 01:28:55 -050060{
Deepak Kodihallibc669f12019-11-28 08:52:07 -060061 public:
Deepak Kodihallib5c227e2020-07-13 06:58:34 -050062 Handler(const pldm::utils::DBusHandler* dBusIntf,
George Liu36e81352020-07-01 14:40:30 +080063 const std::string& pdrJsonsDir, const std::string& eventsJsonsDir,
TOM JOSEPHd4d97a52020-03-23 14:36:34 +053064 pldm_pdr* repo, HostPDRHandler* hostPDRHandler,
George Liucae18662020-05-15 09:32:57 +080065 DbusToPLDMEvent* dbusToPLDMEventHandler, fru::Handler* fruHandler,
66 bool buildPDRLazily = false,
Tom Joseph56e45c52020-03-16 10:01:45 +053067 const std::optional<EventMap>& addOnHandlersMap = std::nullopt) :
Pavithra Barithaya51efaf82020-04-02 02:42:27 -050068 pdrRepo(repo),
Tom Joseph33e9c7e2020-06-11 22:09:52 +053069 hostPDRHandler(hostPDRHandler), stateSensorHandler(eventsJsonsDir),
George Liucae18662020-05-15 09:32:57 +080070 dbusToPLDMEventHandler(dbusToPLDMEventHandler), fruHandler(fruHandler),
71 dBusIntf(dBusIntf), pdrJsonsDir(pdrJsonsDir), pdrCreated(false)
Sampa Misraa2fa0702019-05-31 01:28:55 -050072 {
Deepak Kodihallib5c227e2020-07-13 06:58:34 -050073 if (!buildPDRLazily)
74 {
Sampa Misra12afe112020-05-25 11:40:44 -050075 generateTerminusLocatorPDR(pdrRepo);
Deepak Kodihallib5c227e2020-07-13 06:58:34 -050076 generate(*dBusIntf, pdrJsonsDir, pdrRepo);
77 pdrCreated = true;
78 }
Deepak Kodihallic682fe22020-03-04 00:42:54 -060079
Deepak Kodihallibc669f12019-11-28 08:52:07 -060080 handlers.emplace(PLDM_GET_PDR,
81 [this](const pldm_msg* request, size_t payloadLength) {
82 return this->getPDR(request, payloadLength);
83 });
George Liueccb0c52020-01-14 11:09:56 +080084 handlers.emplace(PLDM_SET_NUMERIC_EFFECTER_VALUE,
85 [this](const pldm_msg* request, size_t payloadLength) {
86 return this->setNumericEffecterValue(
87 request, payloadLength);
88 });
Deepak Kodihallibc669f12019-11-28 08:52:07 -060089 handlers.emplace(PLDM_SET_STATE_EFFECTER_STATES,
90 [this](const pldm_msg* request, size_t payloadLength) {
91 return this->setStateEffecterStates(request,
92 payloadLength);
93 });
Tom Joseph56e45c52020-03-16 10:01:45 +053094 handlers.emplace(PLDM_PLATFORM_EVENT_MESSAGE,
95 [this](const pldm_msg* request, size_t payloadLength) {
96 return this->platformEventMessage(request,
97 payloadLength);
98 });
George Liu362c18d2020-05-14 09:46:36 +080099 handlers.emplace(PLDM_GET_STATE_SENSOR_READINGS,
100 [this](const pldm_msg* request, size_t payloadLength) {
101 return this->getStateSensorReadings(request,
102 payloadLength);
103 });
Tom Joseph56e45c52020-03-16 10:01:45 +0530104
105 // Default handler for PLDM Events
106 eventHandlers[PLDM_SENSOR_EVENT].emplace_back(
107 [this](const pldm_msg* request, size_t payloadLength,
108 uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
109 return this->sensorEvent(request, payloadLength, formatVersion,
110 tid, eventDataOffset);
111 });
Deepak Kodihalli8cb6f662020-04-10 02:55:43 -0500112 eventHandlers[PLDM_PDR_REPOSITORY_CHG_EVENT].emplace_back(
113 [this](const pldm_msg* request, size_t payloadLength,
114 uint8_t formatVersion, uint8_t tid, size_t eventDataOffset) {
115 return this->pldmPDRRepositoryChgEvent(request, payloadLength,
116 formatVersion, tid,
117 eventDataOffset);
118 });
Tom Joseph56e45c52020-03-16 10:01:45 +0530119
120 // Additional OEM event handlers for PLDM events, append it to the
121 // standard handlers
122 if (addOnHandlersMap)
123 {
124 auto addOnHandlers = addOnHandlersMap.value();
125 for (EventMap::iterator iter = addOnHandlers.begin();
126 iter != addOnHandlers.end(); ++iter)
127 {
128 auto search = eventHandlers.find(iter->first);
129 if (search != eventHandlers.end())
130 {
131 search->second.insert(std::end(search->second),
132 std::begin(iter->second),
133 std::end(iter->second));
134 }
135 else
136 {
137 eventHandlers.emplace(iter->first, iter->second);
138 }
139 }
140 }
Sampa Misraa2fa0702019-05-31 01:28:55 -0500141 }
142
George Liu1ec85d42020-02-12 16:05:32 +0800143 pdr_utils::Repo& getRepo()
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600144 {
George Liu1ec85d42020-02-12 16:05:32 +0800145 return this->pdrRepo;
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600146 }
147
George Liu1ec85d42020-02-12 16:05:32 +0800148 /** @brief Add D-Bus mapping and value mapping(stateId to D-Bus) for the
George Liuadbe1722020-05-09 19:20:19 +0800149 * Id. If the same id is added, the previous dbusObjs will
George Liu1ec85d42020-02-12 16:05:32 +0800150 * be "over-written".
151 *
George Liuadbe1722020-05-09 19:20:19 +0800152 * @param[in] Id - effecter/sensor id
George Liu1ec85d42020-02-12 16:05:32 +0800153 * @param[in] dbusObj - list of D-Bus object structure and list of D-Bus
154 * property value to attribute value
George Liuadbe1722020-05-09 19:20:19 +0800155 * @param[in] typeId - the type id of enum
George Liu1ec85d42020-02-12 16:05:32 +0800156 */
George Liua2870722020-02-11 11:09:30 +0800157 void addDbusObjMaps(
George Liuadbe1722020-05-09 19:20:19 +0800158 uint16_t id,
159 std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps> dbusObj,
160 TypeId typeId = TypeId::PLDM_EFFECTER_ID);
George Liu1ec85d42020-02-12 16:05:32 +0800161
George Liuadbe1722020-05-09 19:20:19 +0800162 /** @brief Retrieve an id -> D-Bus objects mapping
George Liu1ec85d42020-02-12 16:05:32 +0800163 *
George Liuadbe1722020-05-09 19:20:19 +0800164 * @param[in] Id - id
165 * @param[in] typeId - the type id of enum
George Liu1ec85d42020-02-12 16:05:32 +0800166 *
George Liua2870722020-02-11 11:09:30 +0800167 * @return std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps> -
168 * list of D-Bus object structure and list of D-Bus property value
169 * to attribute value
George Liu1ec85d42020-02-12 16:05:32 +0800170 */
George Liua2870722020-02-11 11:09:30 +0800171 const std::tuple<pdr_utils::DbusMappings, pdr_utils::DbusValMaps>&
George Liuadbe1722020-05-09 19:20:19 +0800172 getDbusObjMaps(uint16_t id,
173 TypeId typeId = TypeId::PLDM_EFFECTER_ID) const;
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600174
175 uint16_t getNextEffecterId()
176 {
177 return ++nextEffecterId;
178 }
179
George Liuadbe1722020-05-09 19:20:19 +0800180 uint16_t getNextSensorId()
181 {
182 return ++nextSensorId;
183 }
184
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600185 /** @brief Parse PDR JSONs and build PDR repository
186 *
George Liu36e81352020-07-01 14:40:30 +0800187 * @param[in] dBusIntf - The interface object
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600188 * @param[in] dir - directory housing platform specific PDR JSON files
189 * @param[in] repo - instance of concrete implementation of Repo
190 */
George Liu36e81352020-07-01 14:40:30 +0800191 void generate(const pldm::utils::DBusHandler& dBusIntf,
192 const std::string& dir, Repo& repo);
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600193
194 /** @brief Parse PDR JSONs and build state effecter PDR repository
195 *
196 * @param[in] json - platform specific PDR JSON files
197 * @param[in] repo - instance of state effecter implementation of Repo
198 */
199 void generateStateEffecterRepo(const Json& json, Repo& repo);
200
Tom Joseph56e45c52020-03-16 10:01:45 +0530201 /** @brief map of PLDM event type to EventHandlers
202 *
203 */
204 EventMap eventHandlers;
205
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600206 /** @brief Handler for GetPDR
207 *
208 * @param[in] request - Request message payload
209 * @param[in] payloadLength - Request payload length
210 * @param[out] Response - Response message written here
211 */
212 Response getPDR(const pldm_msg* request, size_t payloadLength);
Sampa Misraa2fa0702019-05-31 01:28:55 -0500213
George Liueccb0c52020-01-14 11:09:56 +0800214 /** @brief Handler for setNumericEffecterValue
215 *
216 * @param[in] request - Request message
217 * @param[in] payloadLength - Request payload length
218 * @return Response - PLDM Response message
219 */
220 Response setNumericEffecterValue(const pldm_msg* request,
221 size_t payloadLength);
222
George Liu362c18d2020-05-14 09:46:36 +0800223 /** @brief Handler for getStateSensorReadings
224 *
225 * @param[in] request - Request message
226 * @param[in] payloadLength - Request payload length
227 * @return Response - PLDM Response message
228 */
229 Response getStateSensorReadings(const pldm_msg* request,
230 size_t payloadLength);
231
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600232 /** @brief Handler for setStateEffecterStates
233 *
234 * @param[in] request - Request message
235 * @param[in] payloadLength - Request payload length
236 * @return Response - PLDM Response message
237 */
238 Response setStateEffecterStates(const pldm_msg* request,
239 size_t payloadLength);
240
Tom Joseph56e45c52020-03-16 10:01:45 +0530241 /** @brief Handler for PlatformEventMessage
242 *
243 * @param[in] request - Request message
244 * @param[in] payloadLength - Request payload length
245 * @return Response - PLDM Response message
246 */
247 Response platformEventMessage(const pldm_msg* request,
248 size_t payloadLength);
249
250 /** @brief Handler for event class Sensor event
251 *
252 * @param[in] request - Request message
253 * @param[in] payloadLength - Request payload length
254 * @param[in] formatVersion - Version of the event format
255 * @param[in] tid - Terminus ID of the event's originator
256 * @param[in] eventDataOffset - Offset of the event data in the request
257 * message
258 * @return PLDM completion code
259 */
260 int sensorEvent(const pldm_msg* request, size_t payloadLength,
261 uint8_t formatVersion, uint8_t tid, size_t eventDataOffset);
262
Deepak Kodihalli8cb6f662020-04-10 02:55:43 -0500263 /** @brief Handler for pldmPDRRepositoryChgEvent
264 *
265 * @param[in] request - Request message
266 * @param[in] payloadLength - Request payload length
267 * @param[in] formatVersion - Version of the event format
268 * @param[in] tid - Terminus ID of the event's originator
269 * @param[in] eventDataOffset - Offset of the event data in the request
270 * message
271 * @return PLDM completion code
272 */
273 int pldmPDRRepositoryChgEvent(const pldm_msg* request, size_t payloadLength,
274 uint8_t formatVersion, uint8_t tid,
275 size_t eventDataOffset);
276
277 /** @brief Handler for extracting the PDR handles from changeEntries
278 *
279 * @param[in] changeEntryData - ChangeEntry data from changeRecord
280 * @param[in] changeEntryDataSize - total size of changeEntryData
281 * @param[in] numberOfChangeEntries - total number of changeEntries to
282 * extract
283 * @param[out] pdrRecordHandles - std::vector where the extracted PDR
284 * handles are placed
285 * @return PLDM completion code
286 */
287 int getPDRRecordHandles(const ChangeEntry* changeEntryData,
288 size_t changeEntryDataSize,
289 size_t numberOfChangeEntries,
290 PDRRecordHandles& pdrRecordHandles);
291
Zahed Hossain75330f32020-03-24 02:15:03 -0500292 /** @brief Handler for setting Sensor event data
293 *
294 * @param[in] sensorId - sensorID value of the sensor
295 * @param[in] sensorOffset - Identifies which state sensor within a
296 * composite state sensor the event is being returned for
297 * @param[in] eventState - The event state value from the state change that
298 * triggered the event message
299 * @return PLDM completion code
300 */
301 int setSensorEventData(uint16_t sensorId, uint8_t sensorOffset,
302 uint8_t eventState);
303
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600304 /** @brief Function to set the effecter requested by pldm requester
305 * @param[in] dBusIntf - The interface object
306 * @param[in] effecterId - Effecter ID sent by the requester to act on
307 * @param[in] stateField - The state field data for each of the states,
308 * equal to composite effecter count in number
309 * @return - Success or failure in setting the states. Returns failure in
310 * terms of PLDM completion codes if atleast one state fails to be set
311 */
312 template <class DBusInterface>
313 int setStateEffecterStatesHandler(
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600314 const DBusInterface& dBusIntf, uint16_t effecterId,
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600315 const std::vector<set_effecter_state_field>& stateField)
Sampa Misraa2fa0702019-05-31 01:28:55 -0500316 {
George Liue53193f2020-02-24 09:23:26 +0800317 using namespace pldm::responder::pdr;
George Liu1e44c732020-02-28 20:20:06 +0800318 using namespace pldm::utils;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600319 using StateSetNum = uint8_t;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600320
321 state_effecter_possible_states* states = nullptr;
322 pldm_state_effecter_pdr* pdr = nullptr;
323 uint8_t compEffecterCnt = stateField.size();
George Liu1ec85d42020-02-12 16:05:32 +0800324
325 std::unique_ptr<pldm_pdr, decltype(&pldm_pdr_destroy)>
326 stateEffecterPdrRepo(pldm_pdr_init(), pldm_pdr_destroy);
327 Repo stateEffecterPDRs(stateEffecterPdrRepo.get());
328 getRepoByType(pdrRepo, stateEffecterPDRs, PLDM_STATE_EFFECTER_PDR);
329 if (stateEffecterPDRs.empty())
330 {
331 std::cerr << "Failed to get record by PDR type\n";
332 return PLDM_PLATFORM_INVALID_EFFECTER_ID;
333 }
334
George Liue53193f2020-02-24 09:23:26 +0800335 PdrEntry pdrEntry{};
George Liu1ec85d42020-02-12 16:05:32 +0800336 auto pdrRecord = stateEffecterPDRs.getFirstRecord(pdrEntry);
George Liue53193f2020-02-24 09:23:26 +0800337 while (pdrRecord)
338 {
339 pdr = reinterpret_cast<pldm_state_effecter_pdr*>(pdrEntry.data);
340 if (pdr->effecter_id != effecterId)
Sampa Misraa2fa0702019-05-31 01:28:55 -0500341 {
George Liue53193f2020-02-24 09:23:26 +0800342 pdr = nullptr;
George Liu1ec85d42020-02-12 16:05:32 +0800343 pdrRecord =
344 stateEffecterPDRs.getNextRecord(pdrRecord, pdrEntry);
George Liue53193f2020-02-24 09:23:26 +0800345 continue;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600346 }
George Liue53193f2020-02-24 09:23:26 +0800347
348 states = reinterpret_cast<state_effecter_possible_states*>(
349 pdr->possible_states);
350 if (compEffecterCnt > pdr->composite_effecter_count)
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600351 {
George Liue53193f2020-02-24 09:23:26 +0800352 std::cerr << "The requester sent wrong composite effecter"
353 << " count for the effecter, EFFECTER_ID="
354 << effecterId << "COMP_EFF_CNT=" << compEffecterCnt
355 << "\n";
356 return PLDM_ERROR_INVALID_DATA;
Sampa Misraa2fa0702019-05-31 01:28:55 -0500357 }
George Liue53193f2020-02-24 09:23:26 +0800358 break;
359 }
360
361 if (!pdr)
362 {
363 return PLDM_PLATFORM_INVALID_EFFECTER_ID;
Sampa Misraa2fa0702019-05-31 01:28:55 -0500364 }
Sampa Misraa2fa0702019-05-31 01:28:55 -0500365
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600366 int rc = PLDM_SUCCESS;
George Liu1ec85d42020-02-12 16:05:32 +0800367 try
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600368 {
George Liu1ec85d42020-02-12 16:05:32 +0800369 const auto& [dbusMappings, dbusValMaps] =
George Liuadbe1722020-05-09 19:20:19 +0800370 effecterDbusObjMaps.at(effecterId);
George Liu1ec85d42020-02-12 16:05:32 +0800371 for (uint8_t currState = 0; currState < compEffecterCnt;
372 ++currState)
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600373 {
George Liu1ec85d42020-02-12 16:05:32 +0800374 std::vector<StateSetNum> allowed{};
375 // computation is based on table 79 from DSP0248 v1.1.1
376 uint8_t bitfieldIndex =
377 stateField[currState].effecter_state / 8;
378 uint8_t bit =
379 stateField[currState].effecter_state - (8 * bitfieldIndex);
380 if (states->possible_states_size < bitfieldIndex ||
381 !(states->states[bitfieldIndex].byte & (1 << bit)))
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600382 {
George Liu1ec85d42020-02-12 16:05:32 +0800383 std::cerr
384 << "Invalid state set value, EFFECTER_ID=" << effecterId
385 << " VALUE=" << stateField[currState].effecter_state
386 << " COMPOSITE_EFFECTER_ID=" << currState
387 << " DBUS_PATH=" << dbusMappings[currState].objectPath
388 << "\n";
389 rc = PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600390 break;
391 }
George Liu1ec85d42020-02-12 16:05:32 +0800392 const DBusMapping& dbusMapping = dbusMappings[currState];
393 const StatestoDbusVal& dbusValToMap = dbusValMaps[currState];
394
395 if (stateField[currState].set_request == PLDM_REQUEST_SET)
396 {
397 try
398 {
399 dBusIntf.setDbusProperty(
400 dbusMapping,
401 dbusValToMap.at(
402 stateField[currState].effecter_state));
403 }
404 catch (const std::exception& e)
405 {
406 std::cerr
407 << "Error setting property, ERROR=" << e.what()
408 << " PROPERTY=" << dbusMapping.propertyName
409 << " INTERFACE="
410 << dbusMapping.interface << " PATH="
411 << dbusMapping.objectPath << "\n";
412 return PLDM_ERROR;
413 }
414 }
415 uint8_t* nextState =
416 reinterpret_cast<uint8_t*>(states) +
417 sizeof(state_effecter_possible_states) -
418 sizeof(states->states) +
419 (states->possible_states_size * sizeof(states->states));
420 states = reinterpret_cast<state_effecter_possible_states*>(
421 nextState);
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600422 }
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600423 }
George Liu1ec85d42020-02-12 16:05:32 +0800424 catch (const std::out_of_range& e)
425 {
426 std::cerr << "the effecterId does not exist. effecter id: "
427 << effecterId << e.what() << '\n';
428 }
429
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600430 return rc;
431 }
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600432
Sampa Misra12afe112020-05-25 11:40:44 -0500433 /** @brief Build BMC Terminus Locator PDR
434 *
435 * @param[in] repo - instance of concrete implementation of Repo
436 */
437 void generateTerminusLocatorPDR(Repo& repo);
438
Deepak Kodihallic682fe22020-03-04 00:42:54 -0600439 private:
440 pdr_utils::Repo pdrRepo;
441 uint16_t nextEffecterId{};
George Liuadbe1722020-05-09 19:20:19 +0800442 uint16_t nextSensorId{};
443 DbusObjMaps effecterDbusObjMaps{};
444 DbusObjMaps sensorDbusObjMaps{};
Pavithra Barithaya51efaf82020-04-02 02:42:27 -0500445 HostPDRHandler* hostPDRHandler;
TOM JOSEPHd4d97a52020-03-23 14:36:34 +0530446 events::StateSensorHandler stateSensorHandler;
George Liucae18662020-05-15 09:32:57 +0800447 DbusToPLDMEvent* dbusToPLDMEventHandler;
Tom Joseph33e9c7e2020-06-11 22:09:52 +0530448 fru::Handler* fruHandler;
Deepak Kodihallib5c227e2020-07-13 06:58:34 -0500449 const pldm::utils::DBusHandler* dBusIntf;
450 std::string pdrJsonsDir;
451 bool pdrCreated;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600452};
453
454} // namespace platform
Deepak Kodihalli557dfb02019-05-12 13:11:17 +0530455} // namespace responder
456} // namespace pldm