1 #pragma once
2 
3 #include <optional>
4 #include <string>
5 #include <tuple>
6 
7 namespace phosphor
8 {
9 namespace fan
10 {
11 namespace presence
12 {
13 
14 static const std::string invNamespace = "/xyz/openbmc_project/inventory";
15 
16 /** @brief PrettyName, inventory path and time until error. */
17 using Fan = std::tuple<std::string, std::string, std::optional<size_t>>;
18 
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  */
28 void 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  */
38 bool getPresence(const Fan& fan);
39 } // namespace presence
40 } // namespace fan
41 } // namespace phosphor
42