blob: 9d1fd2003d89f9b62b775f11ad7ef150c556b635 [file] [log] [blame]
Brad Bishop825e31e2017-06-14 16:38:22 -04001#pragma once
2
Matt Spinler9e9f5992020-09-30 08:29:24 -05003#include <optional>
Brad Bishop825e31e2017-06-14 16:38:22 -04004#include <string>
5#include <tuple>
6
7namespace phosphor
8{
9namespace fan
10{
11namespace presence
12{
13
Matt Spinlerc65d91d2021-04-21 13:09:49 -050014static const std::string invNamespace = "/xyz/openbmc_project/inventory";
15
Matt Spinler9e9f5992020-09-30 08:29:24 -050016/** @brief PrettyName, inventory path and time until error. */
17using Fan = std::tuple<std::string, std::string, std::optional<size_t>>;
Brad Bishop825e31e2017-06-14 16:38:22 -040018
19/**
20 * @brief Update the presence state.
21 *
22 * Update the Present property of the
23 * xyz.openbmc_project.Inventory.Item interface.
24 *
25 * @param[in] fan - The fan to update.
26 * @param[in] newState - The new state of the fan.
27 */
28void setPresence(const Fan& fan, bool newState);
29
30/**
31 * @brief Read the presence state.
32 *
33 * Read the Present property of the
34 * xyz.openbmc_project.Inventory.Item
35 *
36 * @param[in] fan - The fan to read.
37 */
38bool getPresence(const Fan& fan);
39} // namespace presence
40} // namespace fan
41} // namespace phosphor