blob: 3eab814807fdf0c106971245ca91e1ada7dc2fc3 [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 Spinler9e9f5992020-09-30 08:29:24 -050014/** @brief PrettyName, inventory path and time until error. */
15using Fan = std::tuple<std::string, std::string, std::optional<size_t>>;
Brad Bishop825e31e2017-06-14 16:38:22 -040016
17/**
18 * @brief Update the presence state.
19 *
20 * Update the Present property of the
21 * xyz.openbmc_project.Inventory.Item interface.
22 *
23 * @param[in] fan - The fan to update.
24 * @param[in] newState - The new state of the fan.
25 */
26void setPresence(const Fan& fan, bool newState);
27
28/**
29 * @brief Read the presence state.
30 *
31 * Read the Present property of the
32 * xyz.openbmc_project.Inventory.Item
33 *
34 * @param[in] fan - The fan to read.
35 */
36bool getPresence(const Fan& fan);
37} // namespace presence
38} // namespace fan
39} // namespace phosphor