blob: cd5f66138222146612f1ceadccd6b51cf8ddf03d [file] [log] [blame]
Marri Devender Rao0acf0572017-07-03 12:25:47 -05001#pragma once
Marri Devender Rao0acf0572017-07-03 12:25:47 -05002#include "ipmi_fru_info_area.hpp"
3
Patrick Venture0b02be92018-08-31 11:55:55 -07004#include <sdbusplus/bus.hpp>
5#include <string>
6
Marri Devender Rao0acf0572017-07-03 12:25:47 -05007namespace ipmi
8{
9namespace fru
10{
11using FRUId = uint8_t;
12using FRUAreaMap = std::map<FRUId, FruAreaData>;
Kirill Pakhomovb118c4b2020-05-08 18:38:26 +030013
14static constexpr auto xyzPrefix = "/xyz/openbmc_project/";
15static constexpr auto invMgrInterface = "xyz.openbmc_project.Inventory.Manager";
16static constexpr auto invObjPath = "/xyz/openbmc_project/inventory";
17static constexpr auto propInterface = "org.freedesktop.DBus.Properties";
Kirill Pakhomovfa6e2092020-04-24 18:57:15 +030018static constexpr auto invItemInterface = "xyz.openbmc_project.Inventory.Item";
19static constexpr auto itemPresentProp = "Present";
Kirill Pakhomovb118c4b2020-05-08 18:38:26 +030020
Marri Devender Rao0acf0572017-07-03 12:25:47 -050021/**
22 * @brief Get fru area data as per IPMI specification
23 *
24 * @param[in] fruNum FRU ID
25 *
26 * @return FRU area data as per IPMI specification
27 */
28const FruAreaData& getFruAreaData(const FRUId& fruNum);
29
Marri Devender Rao908f7502017-07-10 01:49:54 -050030/**
31 * @brief Register callback handler into DBUS for PropertyChange events
32 *
33 * @return negative value on failure
34 */
35int registerCallbackHandler();
Patrick Venture0b02be92018-08-31 11:55:55 -070036} // namespace fru
37} // namespace ipmi