blob: 59b33ea136b01a8b30a89e340bfa0323543d98b1 [file] [log] [blame]
Deepak Kodihalli76794492017-02-16 23:48:18 -06001#pragma once
2
SunnySrivastava1984f6d541e2020-02-04 12:50:40 -06003#include "const.hpp"
Deepak Kodihalli76794492017-02-16 23:48:18 -06004#include "types.hpp"
5
6namespace openpower
7{
8namespace vpd
9{
Santosh Puranikbd011b22020-01-23 04:05:25 -060010/** @brief Return the hex representation of the incoming byte
11 *
12 * @param [in] c - The input byte
13 * @returns The hex representation of the byte as a character.
14 */
15constexpr auto toHex(size_t c)
16{
17 constexpr auto map = "0123456789abcdef";
18 return map[c];
19}
Deepak Kodihalli76794492017-02-16 23:48:18 -060020
21namespace inventory
22{
23
24/** @brief Get inventory-manager's d-bus service
25 */
26auto getPIMService();
27
28/** @brief Call inventory-manager to add objects
29 *
30 * @param [in] objects - Map of inventory object paths
31 */
32void callPIM(ObjectMap&& objects);
33
34} // namespace inventory
35
SunnySrivastava1984f6d541e2020-02-04 12:50:40 -060036/**@brief This API reads 2 Bytes of data and swap the read data
37 * @param[in] iterator- Pointer pointing to the data to be read
38 * @return returns 2 Byte data read at the given pointer
39 */
40openpower::vpd::constants::LE2ByteData
41 readUInt16LE(Binary::const_iterator iterator);
42
Patrick Venturec83c4dc2018-11-01 16:29:18 -070043} // namespace vpd
44} // namespace openpower