Brad Bishop | 825e31e | 2017-06-14 16:38:22 -0400 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Matt Spinler | 9e9f599 | 2020-09-30 08:29:24 -0500 | [diff] [blame] | 3 | #include <optional> |
Brad Bishop | 825e31e | 2017-06-14 16:38:22 -0400 | [diff] [blame] | 4 | #include <string> |
| 5 | #include <tuple> |
| 6 | |
| 7 | namespace phosphor |
| 8 | { |
| 9 | namespace fan |
| 10 | { |
| 11 | namespace presence |
| 12 | { |
| 13 | |
Matt Spinler | c65d91d | 2021-04-21 13:09:49 -0500 | [diff] [blame] | 14 | static const std::string invNamespace = "/xyz/openbmc_project/inventory"; |
| 15 | |
Matt Spinler | 9e9f599 | 2020-09-30 08:29:24 -0500 | [diff] [blame] | 16 | /** @brief PrettyName, inventory path and time until error. */ |
| 17 | using Fan = std::tuple<std::string, std::string, std::optional<size_t>>; |
Brad Bishop | 825e31e | 2017-06-14 16:38:22 -0400 | [diff] [blame] | 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 |