blob: e0997fd74c139681bc526302295ba05e37efdfb0 [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>
Patrick Williamsfbc6c9d2023-05-10 07:50:16 -05005
Patrick Venture0b02be92018-08-31 11:55:55 -07006#include <string>
7
Marri Devender Rao0acf0572017-07-03 12:25:47 -05008namespace ipmi
9{
10namespace fru
11{
12using FRUId = uint8_t;
13using FRUAreaMap = std::map<FRUId, FruAreaData>;
Kirill Pakhomovb118c4b2020-05-08 18:38:26 +030014
15static constexpr auto xyzPrefix = "/xyz/openbmc_project/";
16static constexpr auto invMgrInterface = "xyz.openbmc_project.Inventory.Manager";
17static constexpr auto invObjPath = "/xyz/openbmc_project/inventory";
18static constexpr auto propInterface = "org.freedesktop.DBus.Properties";
Kirill Pakhomovfa6e2092020-04-24 18:57:15 +030019static constexpr auto invItemInterface = "xyz.openbmc_project.Inventory.Item";
20static constexpr auto itemPresentProp = "Present";
Kirill Pakhomovb118c4b2020-05-08 18:38:26 +030021
Marri Devender Rao0acf0572017-07-03 12:25:47 -050022/**
23 * @brief Get fru area data as per IPMI specification
24 *
25 * @param[in] fruNum FRU ID
26 *
27 * @return FRU area data as per IPMI specification
28 */
29const FruAreaData& getFruAreaData(const FRUId& fruNum);
30
Marri Devender Rao908f7502017-07-10 01:49:54 -050031/**
32 * @brief Register callback handler into DBUS for PropertyChange events
33 *
34 * @return negative value on failure
35 */
36int registerCallbackHandler();
Patrick Venture0b02be92018-08-31 11:55:55 -070037} // namespace fru
38} // namespace ipmi