blob: 3e8e19e8c139885df8b17e472cd41c2f55bd53fa [file] [log] [blame]
Sampa Misra032bd502019-03-06 05:03:22 -06001#pragma once
2
Sampa Misraaea5dde2020-08-31 08:33:47 -05003#include "types.hpp"
4
George Liuc453e162022-12-21 17:16:23 +08005#include <libpldm/base.h>
6#include <libpldm/bios.h>
George Liudf9a6d32020-12-22 16:27:16 +08007#include <libpldm/entity.h>
8#include <libpldm/pdr.h>
George Liuc453e162022-12-21 17:16:23 +08009#include <libpldm/platform.h>
10#include <libpldm/utils.h>
Sampa Misra032bd502019-03-06 05:03:22 -060011#include <stdint.h>
12#include <systemd/sd-bus.h>
Jinu Joy Thomasf666db12019-05-29 05:22:31 -050013#include <unistd.h>
Sampa Misra032bd502019-03-06 05:03:22 -060014
George Liu6492f522020-06-16 10:34:05 +080015#include <nlohmann/json.hpp>
16#include <sdbusplus/server.hpp>
Riya Dixit754041d2024-02-20 06:15:49 -060017#include <xyz/openbmc_project/Inventory/Manager/client.hpp>
George Liu6492f522020-06-16 10:34:05 +080018#include <xyz/openbmc_project/Logging/Entry/server.hpp>
Gilbert Chen44524a52022-02-14 12:12:25 +000019#include <xyz/openbmc_project/ObjectMapper/client.hpp>
George Liu6492f522020-06-16 10:34:05 +080020
George Liudf9a6d32020-12-22 16:27:16 +080021#include <deque>
Sampa Misraa2fa0702019-05-31 01:28:55 -050022#include <exception>
Deepak Kodihalli3cd61812020-03-10 06:38:45 -050023#include <filesystem>
Sampa Misraaa8ae722019-12-12 03:20:40 -060024#include <iostream>
George Liudf9a6d32020-12-22 16:27:16 +080025#include <map>
Sampa Misra032bd502019-03-06 05:03:22 -060026#include <string>
Sampa Misraa2fa0702019-05-31 01:28:55 -050027#include <variant>
28#include <vector>
Sampa Misra032bd502019-03-06 05:03:22 -060029
vkaverap@in.ibm.com5b71b862023-08-21 05:19:04 +000030constexpr uint64_t dbusTimeout =
31 std::chrono::duration_cast<std::chrono::microseconds>(
32 std::chrono::seconds(DBUS_TIMEOUT))
33 .count();
34
Sampa Misra032bd502019-03-06 05:03:22 -060035namespace pldm
36{
Jinu Joy Thomasf666db12019-05-29 05:22:31 -050037namespace utils
38{
Deepak Kodihalli3cd61812020-03-10 06:38:45 -050039namespace fs = std::filesystem;
Tom Joseph250c4752020-04-15 10:32:45 +053040using Json = nlohmann::json;
Tom Josephe5268cd2021-09-07 13:04:03 +053041constexpr bool Tx = true;
42constexpr bool Rx = false;
Gilbert Chen44524a52022-02-14 12:12:25 +000043using ObjectMapper = sdbusplus::client::xyz::openbmc_project::ObjectMapper<>;
Gilbert Chen44524a52022-02-14 12:12:25 +000044using inventoryManager =
45 sdbusplus::client::xyz::openbmc_project::inventory::Manager<>;
46
47constexpr auto dbusProperties = "org.freedesktop.DBus.Properties";
48constexpr auto mapperService = ObjectMapper::default_service;
49constexpr auto inventoryPath = "/xyz/openbmc_project/inventory";
Jinu Joy Thomasf666db12019-05-29 05:22:31 -050050/** @struct CustomFD
51 *
52 * RAII wrapper for file descriptor.
53 */
54struct CustomFD
55{
56 CustomFD(const CustomFD&) = delete;
57 CustomFD& operator=(const CustomFD&) = delete;
58 CustomFD(CustomFD&&) = delete;
59 CustomFD& operator=(CustomFD&&) = delete;
60
Patrick Williams6da4f912023-05-10 07:50:53 -050061 CustomFD(int fd) : fd(fd) {}
Jinu Joy Thomasf666db12019-05-29 05:22:31 -050062
63 ~CustomFD()
64 {
65 if (fd >= 0)
66 {
67 close(fd);
68 }
69 }
70
71 int operator()() const
72 {
73 return fd;
74 }
75
76 private:
77 int fd = -1;
78};
79
Sampa Misrab37be312019-07-03 02:26:41 -050080/** @brief Calculate the pad for PLDM data
81 *
82 * @param[in] data - Length of the data
83 * @return - uint8_t - number of pad bytes
84 */
85uint8_t getNumPadBytes(uint32_t data);
86
George Liu83409572019-12-24 18:42:54 +080087/** @brief Convert uint64 to date
88 *
89 * @param[in] data - time date of uint64
90 * @param[out] year - year number in dec
91 * @param[out] month - month number in dec
92 * @param[out] day - day of the month in dec
93 * @param[out] hour - number of hours in dec
94 * @param[out] min - number of minutes in dec
95 * @param[out] sec - number of seconds in dec
96 * @return true if decode success, false if decode faild
97 */
98bool uintToDate(uint64_t data, uint16_t* year, uint8_t* month, uint8_t* day,
99 uint8_t* hour, uint8_t* min, uint8_t* sec);
100
101/** @brief Convert effecter data to structure of set_effecter_state_field
102 *
103 * @param[in] effecterData - the date of effecter
George Liuba4c1fb2020-02-05 14:13:30 +0800104 * @param[in] effecterCount - the number of individual sets of effecter
105 * information
106 * @return[out] parse success and get a valid set_effecter_state_field
107 * structure, return nullopt means parse failed
George Liu83409572019-12-24 18:42:54 +0800108 */
George Liuba4c1fb2020-02-05 14:13:30 +0800109std::optional<std::vector<set_effecter_state_field>>
110 parseEffecterData(const std::vector<uint8_t>& effecterData,
111 uint8_t effecterCount);
Sampa Misra032bd502019-03-06 05:03:22 -0600112
113/**
Sampa Misraaa8ae722019-12-12 03:20:40 -0600114 * @brief creates an error log
115 * @param[in] errorMsg - the error message
116 */
Manojkiran Eda92fb0b52024-04-17 10:48:17 +0530117void reportError(const char* errorMsg);
Sampa Misraaa8ae722019-12-12 03:20:40 -0600118
Sampa Misra032bd502019-03-06 05:03:22 -0600119/** @brief Convert any Decimal number to BCD
120 *
121 * @tparam[in] decimal - Decimal number
122 * @return Corresponding BCD number
123 */
124template <typename T>
125T decimalToBcd(T decimal)
126{
127 T bcd = 0;
128 T rem = 0;
129 auto cnt = 0;
130
131 while (decimal)
132 {
133 rem = decimal % 10;
134 bcd = bcd + (rem << cnt);
135 decimal = decimal / 10;
136 cnt += 4;
137 }
138
139 return bcd;
140}
141
George Liu1e44c732020-02-28 20:20:06 +0800142struct DBusMapping
143{
144 std::string objectPath; //!< D-Bus object path
145 std::string interface; //!< D-Bus interface
146 std::string propertyName; //!< D-Bus property name
147 std::string propertyType; //!< D-Bus property type
148};
149
150using PropertyValue =
151 std::variant<bool, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t,
Riya Dixit754041d2024-02-20 06:15:49 -0600152 uint64_t, double, std::string, std::vector<uint8_t>,
153 std::vector<std::string>>;
Deepak Kodihalli6b1d1ca2020-04-27 07:24:51 -0500154using DbusProp = std::string;
155using DbusChangedProps = std::map<DbusProp, PropertyValue>;
Sampa Misraaea5dde2020-08-31 08:33:47 -0500156using DBusInterfaceAdded = std::vector<
157 std::pair<pldm::dbus::Interface,
158 std::vector<std::pair<pldm::dbus::Property,
159 std::variant<pldm::dbus::Property>>>>>;
Manojkiran Eda1ef62c32021-04-24 07:23:18 +0530160using ObjectPath = std::string;
161using ServiceName = std::string;
162using Interfaces = std::vector<std::string>;
163using MapperServiceMap = std::vector<std::pair<ServiceName, Interfaces>>;
164using GetSubTreeResponse = std::vector<std::pair<ObjectPath, MapperServiceMap>>;
Pavithra Barithaya2ec82692024-04-29 06:31:10 -0500165using GetSubTreePathsResponse = std::vector<std::string>;
Sridevi Ramesheefe49b2022-06-27 11:51:02 -0500166using PropertyMap = std::map<std::string, PropertyValue>;
167using InterfaceMap = std::map<std::string, PropertyMap>;
Riya Dixit754041d2024-02-20 06:15:49 -0600168using ObjectValueTree = std::map<sdbusplus::message::object_path, InterfaceMap>;
George Liu1e44c732020-02-28 20:20:06 +0800169
170/**
171 * @brief The interface for DBusHandler
172 */
173class DBusHandlerInterface
174{
175 public:
176 virtual ~DBusHandlerInterface() = default;
177
George Liu36e81352020-07-01 14:40:30 +0800178 virtual std::string getService(const char* path,
179 const char* interface) const = 0;
Manojkiran Eda1ef62c32021-04-24 07:23:18 +0530180 virtual GetSubTreeResponse
181 getSubtree(const std::string& path, int depth,
182 const std::vector<std::string>& ifaceList) const = 0;
George Liu36e81352020-07-01 14:40:30 +0800183
Pavithra Barithaya2ec82692024-04-29 06:31:10 -0500184 virtual GetSubTreePathsResponse
185 getSubTreePaths(const std::string& objectPath, int depth,
186 const std::vector<std::string>& ifaceList) const = 0;
187
George Liu1e44c732020-02-28 20:20:06 +0800188 virtual void setDbusProperty(const DBusMapping& dBusMap,
189 const PropertyValue& value) const = 0;
John Wang9e242422020-03-05 08:37:50 +0800190
191 virtual PropertyValue
192 getDbusPropertyVariant(const char* objPath, const char* dbusProp,
193 const char* dbusInterface) const = 0;
Gilbert Chen44524a52022-02-14 12:12:25 +0000194
195 virtual PropertyMap
196 getDbusPropertiesVariant(const char* serviceName, const char* objPath,
197 const char* dbusInterface) const = 0;
George Liu1e44c732020-02-28 20:20:06 +0800198};
199
Sampa Misraa2fa0702019-05-31 01:28:55 -0500200/**
201 * @class DBusHandler
202 *
203 * Wrapper class to handle the D-Bus calls
204 *
205 * This class contains the APIs to handle the D-Bus calls
206 * to cater the request from pldm requester.
207 * A class is created to mock the apis in the test cases
208 */
George Liu1e44c732020-02-28 20:20:06 +0800209class DBusHandler : public DBusHandlerInterface
Sampa Misraa2fa0702019-05-31 01:28:55 -0500210{
211 public:
George Liu0e02c322020-01-01 09:41:51 +0800212 /** @brief Get the bus connection. */
213 static auto& getBus()
214 {
215 static auto bus = sdbusplus::bus::new_default();
216 return bus;
217 }
218
219 /**
220 * @brief Get the DBUS Service name for the input dbus path
John Wang9e242422020-03-05 08:37:50 +0800221 *
George Liu0e02c322020-01-01 09:41:51 +0800222 * @param[in] path - DBUS object path
223 * @param[in] interface - DBUS Interface
John Wang9e242422020-03-05 08:37:50 +0800224 *
George Liu0e02c322020-01-01 09:41:51 +0800225 * @return std::string - the dbus service name
John Wang9e242422020-03-05 08:37:50 +0800226 *
Patrick Williams84b790c2022-07-22 19:26:56 -0500227 * @throw sdbusplus::exception_t when it fails
George Liu0e02c322020-01-01 09:41:51 +0800228 */
George Liu36e81352020-07-01 14:40:30 +0800229 std::string getService(const char* path,
230 const char* interface) const override;
George Liu0e02c322020-01-01 09:41:51 +0800231
Manojkiran Eda1ef62c32021-04-24 07:23:18 +0530232 /**
233 * @brief Get the Subtree response from the mapper
234 *
235 * @param[in] path - DBUS object path
236 * @param[in] depth - Search depth
237 * @param[in] ifaceList - list of the interface that are being
238 * queried from the mapper
239 *
240 * @return GetSubTreeResponse - the mapper subtree response
241 *
Patrick Williams84b790c2022-07-22 19:26:56 -0500242 * @throw sdbusplus::exception_t when it fails
Manojkiran Eda1ef62c32021-04-24 07:23:18 +0530243 */
244 GetSubTreeResponse
245 getSubtree(const std::string& path, int depth,
246 const std::vector<std::string>& ifaceList) const override;
247
Pavithra Barithaya2ec82692024-04-29 06:31:10 -0500248 /** @brief Get Subtree path response from the mapper
249 *
250 * @param[in] path - DBUS object path
251 * @param[in] depth - Search depth
252 * @param[in] ifaceList - list of the interface that are being
253 * queried from the mapper
254 *
255 * @return std::vector<std::string> vector of subtree paths
256 */
257 GetSubTreePathsResponse getSubTreePaths(
258 const std::string& objectPath, int depth,
259 const std::vector<std::string>& ifaceList) const override;
260
John Wang9e242422020-03-05 08:37:50 +0800261 /** @brief Get property(type: variant) from the requested dbus
262 *
263 * @param[in] objPath - The Dbus object path
264 * @param[in] dbusProp - The property name to get
265 * @param[in] dbusInterface - The Dbus interface
266 *
267 * @return The value of the property(type: variant)
268 *
Patrick Williams84b790c2022-07-22 19:26:56 -0500269 * @throw sdbusplus::exception_t when it fails
John Wang9e242422020-03-05 08:37:50 +0800270 */
271 PropertyValue
272 getDbusPropertyVariant(const char* objPath, const char* dbusProp,
273 const char* dbusInterface) const override;
George Liu0e02c322020-01-01 09:41:51 +0800274
Gilbert Chen44524a52022-02-14 12:12:25 +0000275 /** @brief Get All properties(type: variant) from the requested dbus
276 *
277 * @param[in] serviceName - The Dbus service name
278 * @param[in] objPath - The Dbus object path
279 * @param[in] dbusInterface - The Dbus interface
280 *
281 * @return The values of the properties(type: variant)
282 *
283 * @throw sdbusplus::exception_t when it fails
284 */
285 PropertyMap
286 getDbusPropertiesVariant(const char* serviceName, const char* objPath,
287 const char* dbusInterface) const override;
288
John Wang9e242422020-03-05 08:37:50 +0800289 /** @brief The template function to get property from the requested dbus
290 * path
291 *
292 * @tparam Property - Excepted type of the property on dbus
293 *
294 * @param[in] objPath - The Dbus object path
295 * @param[in] dbusProp - The property name to get
296 * @param[in] dbusInterface - The Dbus interface
297 *
298 * @return The value of the property
299 *
Patrick Williams84b790c2022-07-22 19:26:56 -0500300 * @throw sdbusplus::exception_t when dbus request fails
John Wang9e242422020-03-05 08:37:50 +0800301 * std::bad_variant_access when \p Property and property on dbus do
302 * not match
303 */
John Wang92b3c972019-10-17 11:06:41 +0800304 template <typename Property>
305 auto getDbusProperty(const char* objPath, const char* dbusProp,
306 const char* dbusInterface)
307 {
Patrick Williams6da4f912023-05-10 07:50:53 -0500308 auto VariantValue = getDbusPropertyVariant(objPath, dbusProp,
309 dbusInterface);
John Wang92b3c972019-10-17 11:06:41 +0800310 return std::get<Property>(VariantValue);
311 }
George Liu1e44c732020-02-28 20:20:06 +0800312
313 /** @brief Set Dbus property
314 *
315 * @param[in] dBusMap - Object path, property name, interface and property
316 * type for the D-Bus object
317 * @param[in] value - The value to be set
John Wang9e242422020-03-05 08:37:50 +0800318 *
Patrick Williams84b790c2022-07-22 19:26:56 -0500319 * @throw sdbusplus::exception_t when it fails
George Liu1e44c732020-02-28 20:20:06 +0800320 */
321 void setDbusProperty(const DBusMapping& dBusMap,
322 const PropertyValue& value) const override;
Riya Dixit754041d2024-02-20 06:15:49 -0600323
324 /** @brief This function retrieves the properties of an object managed
325 * by the specified D-Bus service located at the given object path.
326 *
327 * @param[in] service - The D-Bus service providing the managed object
328 * @param[in] value - The object path of the managed object
329 *
330 * @return A hierarchical structure representing the properties of the
331 * managed object.
Patrick Williams897b0f82024-04-14 02:31:48 -0500332 * @throw sdbusplus::exception_t when it fails
Riya Dixit754041d2024-02-20 06:15:49 -0600333 */
334 static ObjectValueTree getManagedObj(const char* service, const char* path);
335
336 /** @brief Retrieve the inventory objects managed by a specified class.
337 * The retrieved inventory objects are cached statically
338 * and returned upon subsequent calls to this function.
339 *
340 * @tparam ClassType - The class type that manages the inventory objects.
341 *
342 * @return A reference to the cached inventory objects.
343 */
344 template <typename ClassType>
345 static auto& getInventoryObjects()
346 {
347 static ObjectValueTree object = ClassType::getManagedObj(
348 inventoryManager::interface, inventoryPath);
349 return object;
350 }
Sampa Misraa2fa0702019-05-31 01:28:55 -0500351};
352
Deepak Kodihalli3cd61812020-03-10 06:38:45 -0500353/** @brief Fetch parent D-Bus object based on pathname
354 *
355 * @param[in] dbusObj - child D-Bus object
356 *
357 * @return std::string - the parent D-Bus object path
358 */
359inline std::string findParent(const std::string& dbusObj)
360{
361 fs::path p(dbusObj);
362 return p.parent_path().string();
363}
364
Pavithra Barithaya51efaf82020-04-02 02:42:27 -0500365/** @brief Read (static) MCTP EID of host firmware from a file
366 *
367 * @return uint8_t - MCTP EID
368 */
369uint8_t readHostEID();
Tom Joseph250c4752020-04-15 10:32:45 +0530370
TOM JOSEPHd4d97a52020-03-23 14:36:34 +0530371/** @brief Convert a value in the JSON to a D-Bus property value
372 *
373 * @param[in] type - type of the D-Bus property
374 * @param[in] value - value in the JSON file
375 *
376 * @return PropertyValue - the D-Bus property value
377 */
378PropertyValue jsonEntryToDbusVal(std::string_view type,
379 const nlohmann::json& value);
Pavithra Barithaya51efaf82020-04-02 02:42:27 -0500380
Pavithra Barithaya0f74c982020-04-27 02:17:10 -0500381/** @brief Find State Effecter PDR
382 * @param[in] tid - PLDM terminus ID.
383 * @param[in] entityID - entity that can be associated with PLDM State set.
384 * @param[in] stateSetId - value that identifies PLDM State set.
385 * @param[in] repo - pointer to BMC's primary PDR repo.
386 * @return array[array[uint8_t]] - StateEffecterPDRs
387 */
388std::vector<std::vector<uint8_t>> findStateEffecterPDR(uint8_t tid,
389 uint16_t entityID,
390 uint16_t stateSetId,
391 const pldm_pdr* repo);
Chicago Duan738e4d82020-05-28 16:39:19 +0800392/** @brief Find State Sensor PDR
393 * @param[in] tid - PLDM terminus ID.
394 * @param[in] entityID - entity that can be associated with PLDM State set.
395 * @param[in] stateSetId - value that identifies PLDM State set.
396 * @param[in] repo - pointer to BMC's primary PDR repo.
397 * @return array[array[uint8_t]] - StateSensorPDRs
398 */
399std::vector<std::vector<uint8_t>> findStateSensorPDR(uint8_t tid,
400 uint16_t entityID,
401 uint16_t stateSetId,
402 const pldm_pdr* repo);
Pavithra Barithaya0f74c982020-04-27 02:17:10 -0500403
Sampa Misra3a0e3b92020-10-21 05:58:00 -0500404/** @brief Find sensor id from a state sensor PDR
405 *
406 * @param[in] pdrRepo - PDR repository
407 * @param[in] tid - terminus id
408 * @param[in] entityType - entity type
409 * @param[in] entityInstance - entity instance number
410 * @param[in] containerId - container id
411 * @param[in] stateSetId - state set id
412 *
413 * @return uint16_t - the sensor id
414 */
415uint16_t findStateSensorId(const pldm_pdr* pdrRepo, uint8_t tid,
416 uint16_t entityType, uint16_t entityInstance,
417 uint16_t containerId, uint16_t stateSetId);
418
Tom Joseph250c4752020-04-15 10:32:45 +0530419/** @brief Find effecter id from a state effecter pdr
420 * @param[in] pdrRepo - PDR repository
421 * @param[in] entityType - entity type
422 * @param[in] entityInstance - entity instance number
423 * @param[in] containerId - container id
424 * @param[in] stateSetId - state set id
Sampa Misraa4a96162020-07-14 05:33:46 -0500425 * @param[in] localOrRemote - true for checking local repo and false for remote
426 * repo
Tom Joseph250c4752020-04-15 10:32:45 +0530427 *
428 * @return uint16_t - the effecter id
429 */
430uint16_t findStateEffecterId(const pldm_pdr* pdrRepo, uint16_t entityType,
431 uint16_t entityInstance, uint16_t containerId,
Sampa Misraa4a96162020-07-14 05:33:46 -0500432 uint16_t stateSetId, bool localOrRemote);
Tom Joseph250c4752020-04-15 10:32:45 +0530433
Chicago Duanfe4d88b2020-06-12 16:44:13 +0800434/** @brief Emit the sensor event signal
435 *
436 * @param[in] tid - the terminus id
437 * @param[in] sensorId - sensorID value of the sensor
438 * @param[in] sensorOffset - Identifies which state sensor within a
439 * composite state sensor the event is being returned for
440 * @param[in] eventState - The event state value from the state change that
441 * triggered the event message
442 * @param[in] previousEventState - The event state value for the state from
443 * which the present event state was entered.
444 * @return PLDM completion code
445 */
446int emitStateSensorEventSignal(uint8_t tid, uint16_t sensorId,
447 uint8_t sensorOffset, uint8_t eventState,
448 uint8_t previousEventState);
449
Sridevi Rameshae28bc72020-12-10 07:21:16 -0600450/** @brief Print the buffer
451 *
Tom Josephe5268cd2021-09-07 13:04:03 +0530452 * @param[in] isTx - True if the buffer is an outgoing PLDM message, false if
453 the buffer is an incoming PLDM message
454 * @param[in] buffer - Buffer to print
Sridevi Rameshae28bc72020-12-10 07:21:16 -0600455 *
456 * @return - None
457 */
Tom Josephe5268cd2021-09-07 13:04:03 +0530458void printBuffer(bool isTx, const std::vector<uint8_t>& buffer);
Sridevi Rameshae28bc72020-12-10 07:21:16 -0600459
Tom Joseph54922072021-06-19 02:45:46 -0700460/** @brief Convert the buffer to std::string
461 *
462 * If there are characters that are not printable characters, it is replaced
463 * with space(0x20).
464 *
465 * @param[in] var - pointer to data and length of the data
466 *
467 * @return std::string equivalent of variable field
468 */
469std::string toString(const struct variable_field& var);
470
George Liu872f0f62021-11-25 16:26:16 +0800471/** @brief Split strings according to special identifiers
472 *
473 * We can split the string according to the custom identifier(';', ',', '&' or
474 * others) and store it to vector.
475 *
476 * @param[in] srcStr - The string to be split
477 * @param[in] delim - The custom identifier
478 * @param[in] trimStr - The first and last string to be trimmed
479 *
480 * @return std::vector<std::string> Vectors are used to store strings
481 */
482std::vector<std::string> split(std::string_view srcStr, std::string_view delim,
483 std::string_view trimStr = "");
Manojkiran Edaef773052021-07-29 09:29:28 +0530484/** @brief Get the current system time in readable format
485 *
486 * @return - std::string equivalent of the system time
487 */
488std::string getCurrentSystemTime();
George Liu872f0f62021-11-25 16:26:16 +0800489
Sridevi Ramesheefe49b2022-06-27 11:51:02 -0500490/** @brief checks if the FRU is actually present.
491 * @param[in] objPath - FRU object path.
492 *
493 * @return bool to indicate presence or absence of FRU.
494 */
495bool checkForFruPresence(const std::string& objPath);
496
Sagar Srinivas5db6e872023-12-01 10:03:30 -0600497/** @brief Method to check if the logical bit is set
498 *
499 * @param[containerId] - container id of the entity
500 *
501 * @return true or false based on the logic bit set
502 */
503bool checkIfLogicalBitSet(const uint16_t& containerId);
Pavithra Barithaya5e542be2021-08-13 00:33:31 -0500504
505/** @brief setting the present property
506 *
507 * @param[in] objPath - the object path of the fru
508 * @param[in] present - status to set either true/false
509 */
510void setFruPresence(const std::string& fruObjPath, bool present);
George Liu83409572019-12-24 18:42:54 +0800511} // namespace utils
Sampa Misra032bd502019-03-06 05:03:22 -0600512} // namespace pldm