Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2020 IBM Corporation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #pragma once |
| 17 | |
| 18 | #include "config_base.hpp" |
Matthew Barth | de90fb4 | 2021-03-04 16:34:28 -0600 | [diff] [blame] | 19 | #include "fan.hpp" |
Matthew Barth | a0dd135 | 2021-03-09 11:10:49 -0600 | [diff] [blame] | 20 | #include "xyz/openbmc_project/Control/ThermalMode/server.hpp" |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 21 | |
| 22 | #include <nlohmann/json.hpp> |
Matthew Barth | acd737c | 2021-03-04 11:04:01 -0600 | [diff] [blame] | 23 | #include <sdbusplus/bus.hpp> |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 24 | |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 25 | #include <any> |
| 26 | #include <functional> |
| 27 | #include <map> |
| 28 | #include <tuple> |
| 29 | |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 30 | namespace phosphor::fan::control::json |
| 31 | { |
| 32 | |
| 33 | using json = nlohmann::json; |
| 34 | |
Matthew Barth | a0dd135 | 2021-03-09 11:10:49 -0600 | [diff] [blame] | 35 | /* Extend the Control::ThermalMode interface */ |
| 36 | using ThermalObject = sdbusplus::server::object::object< |
| 37 | sdbusplus::xyz::openbmc_project::Control::server::ThermalMode>; |
| 38 | |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 39 | /* Interface property handler function */ |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 40 | using propHandler = std::function<ZoneHandler(const json&, bool)>; |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 41 | |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 42 | /** |
| 43 | * @class Zone - Represents a configured fan control zone |
| 44 | * |
| 45 | * A zone object contains the configured attributes for a zone that groups |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 46 | * a number of fans together to be under the same target control. These |
| 47 | * configuration attributes include, but are not limited to, the default ceiling |
| 48 | * of the fans within the zone, a default floor, the delay between increases, a |
| 49 | * decrease interval, and any profiles(OPTIONAL) the zone should be included in. |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 50 | * |
| 51 | * (When no profile for a zone is given, the zone defaults to always exist) |
| 52 | * |
| 53 | */ |
Matthew Barth | a0dd135 | 2021-03-09 11:10:49 -0600 | [diff] [blame] | 54 | class Zone : public ConfigBase, public ThermalObject |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 55 | { |
| 56 | public: |
| 57 | /* JSON file name for zones */ |
| 58 | static constexpr auto confFileName = "zones.json"; |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 59 | static constexpr auto thermModeIntf = |
| 60 | "xyz.openbmc_project.Control.ThermalMode"; |
| 61 | static constexpr auto supportedProp = "Supported"; |
| 62 | static constexpr auto currentProp = "Current"; |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 63 | |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 64 | Zone() = delete; |
| 65 | Zone(const Zone&) = delete; |
| 66 | Zone(Zone&&) = delete; |
| 67 | Zone& operator=(const Zone&) = delete; |
| 68 | Zone& operator=(Zone&&) = delete; |
| 69 | ~Zone() = default; |
| 70 | |
| 71 | /** |
| 72 | * Constructor |
| 73 | * Parses and populates a zone from JSON object data |
| 74 | * |
Matthew Barth | acd737c | 2021-03-04 11:04:01 -0600 | [diff] [blame] | 75 | * @param[in] bus - sdbusplus bus object |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 76 | * @param[in] jsonObj - JSON object |
| 77 | */ |
Matthew Barth | acd737c | 2021-03-04 11:04:01 -0600 | [diff] [blame] | 78 | Zone(sdbusplus::bus::bus& bus, const json& jsonObj); |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 79 | |
| 80 | /** |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 81 | * @brief Get the default ceiling |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 82 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 83 | * Default ceiling is the highest target the fans within this zone is |
| 84 | * allowed to increase to. The zone's ceiling defaults to this unless |
| 85 | * changed by some configured event. |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 86 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 87 | * @return Default ceiling of this zone |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 88 | */ |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 89 | inline const auto& getDefaultCeiling() const |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 90 | { |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 91 | return _defaultCeiling; |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | /** |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 95 | * @brief Get the default floor |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 96 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 97 | * The default floor is the lowest target the fans within this zone |
| 98 | * are allowed to decrease to. The zone's floor defaults to this |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 99 | * unless changed by some configured event. |
| 100 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 101 | * @return Default floor |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 102 | */ |
| 103 | inline const auto& getDefaultFloor() const |
| 104 | { |
| 105 | return _defaultFloor; |
| 106 | } |
| 107 | |
| 108 | /** |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 109 | * @brief Get the increase delay(OPTIONAL) |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 110 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 111 | * The increase delay is the amount of time(in seconds) increases |
| 112 | * to a target are delayed before being made. The default is 0, which |
| 113 | * results in immediate increase requests when any events result in |
| 114 | * a change to the target. |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 115 | * |
| 116 | * It is recommend a value other than 0 is configured, but that inherently |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 117 | * depends on the fan controller and configured increases. |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 118 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 119 | * @return Increase delay(in seconds) |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 120 | */ |
| 121 | inline const auto& getIncDelay() const |
| 122 | { |
| 123 | return _incDelay; |
| 124 | } |
| 125 | |
| 126 | /** |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 127 | * @brief Get the decrease interval |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 128 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 129 | * Decreases happen on a set interval when no requests for an increase |
| 130 | * in fan targets exists. This is the interval(in seconds) at which the fans |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 131 | * within the zone are decreased if events exist that result in a target |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 132 | * decrease. |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 133 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 134 | * @return Decrease interval(in seconds) |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 135 | */ |
| 136 | inline const auto& getDecInterval() const |
| 137 | { |
| 138 | return _decInterval; |
| 139 | } |
| 140 | |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 141 | /** |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 142 | * @brief Get the configuration of zone interface handlers |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 143 | * |
| 144 | * Interfaces hosted by a zone can optionally be configured to set their |
| 145 | * property values and/or persistency. These interfaces must be supported |
| 146 | * by the zone object they are configured for. |
| 147 | * |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 148 | * @return List of zone interface handler functions that set an interface's |
| 149 | * property values and persistency states |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 150 | */ |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 151 | inline const auto& getZoneHandlers() const |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 152 | { |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 153 | return _zoneHandlers; |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 154 | } |
| 155 | |
Matthew Barth | de90fb4 | 2021-03-04 16:34:28 -0600 | [diff] [blame] | 156 | /** |
| 157 | * @brief Add a fan object to the zone |
| 158 | * |
| 159 | * @param[in] fan - Unique pointer to a fan object that will be moved into |
| 160 | * the zone |
| 161 | * |
| 162 | * Adds a fan object to the list of fans that make up the zone by moving the |
| 163 | * fan object into the list. |
| 164 | */ |
| 165 | void addFan(std::unique_ptr<Fan> fan); |
| 166 | |
Matthew Barth | 12cb125 | 2021-03-08 16:47:30 -0600 | [diff] [blame] | 167 | /** |
| 168 | * @brief Set the floor to the given target and increase target to the floor |
| 169 | * when the target is below the floor value when floor changes are allowed. |
| 170 | * |
| 171 | * @param[in] target - Target to set the floor to |
| 172 | */ |
| 173 | void setFloor(uint64_t target); |
| 174 | |
| 175 | /** |
| 176 | * @brief Sets the floor change allowed state |
| 177 | * |
| 178 | * @param[in] ident - An identifier that affects floor changes |
| 179 | * @param[in] isAllow - Allow state according to the identifier |
| 180 | */ |
| 181 | inline void setFloorChangeAllow(const std::string& ident, bool isAllow) |
| 182 | { |
| 183 | _floorChange[ident] = isAllow; |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * @brief Calculate the requested target from the given delta and increases |
| 188 | * the fans, not going above the ceiling. |
| 189 | * |
| 190 | * @param[in] targetDelta - The delta to increase the target by |
| 191 | */ |
| 192 | void requestIncrease(uint64_t targetDelta); |
| 193 | |
Matthew Barth | a0dd135 | 2021-03-09 11:10:49 -0600 | [diff] [blame] | 194 | /** |
| 195 | * @brief Set a property to be persisted |
| 196 | * |
| 197 | * @param[in] intf - Interface containing property |
| 198 | * @param[in] prop - Property to be persisted |
| 199 | */ |
| 200 | void setPersisted(const std::string& intf, const std::string& prop); |
| 201 | |
| 202 | /** |
| 203 | * @brief Overridden thermal object's set 'Current' property function |
| 204 | * |
| 205 | * @param[in] value - Value to set 'Current' to |
| 206 | * |
| 207 | * @return - The updated value of the 'Current' property |
| 208 | */ |
| 209 | std::string current(std::string value) override; |
| 210 | |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 211 | private: |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 212 | /* The zone's default ceiling value for fans */ |
| 213 | uint64_t _defaultCeiling; |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 214 | |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 215 | /* The zone's default floor value for fans */ |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 216 | uint64_t _defaultFloor; |
| 217 | |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 218 | /* Zone's increase delay(in seconds) (OPTIONAL) */ |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 219 | uint64_t _incDelay; |
| 220 | |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 221 | /* Zone's decrease interval(in seconds) */ |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 222 | uint64_t _decInterval; |
| 223 | |
Matthew Barth | 12cb125 | 2021-03-08 16:47:30 -0600 | [diff] [blame] | 224 | /* The floor target to not go below */ |
| 225 | uint64_t _floor; |
| 226 | |
| 227 | /* Target for this zone */ |
| 228 | uint64_t _target; |
| 229 | |
| 230 | /* Map of whether floor changes are allowed by a string identifier */ |
| 231 | std::map<std::string, bool> _floorChange; |
| 232 | |
Matthew Barth | a0dd135 | 2021-03-09 11:10:49 -0600 | [diff] [blame] | 233 | /* Map of interfaces to persisted properties the zone hosts*/ |
| 234 | std::map<std::string, std::vector<std::string>> _propsPersisted; |
| 235 | |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 236 | /** |
| 237 | * Zone interface handler functions for its |
| 238 | * configured interfaces (OPTIONAL) |
| 239 | */ |
| 240 | std::vector<ZoneHandler> _zoneHandlers; |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 241 | |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 242 | /* Interface to property mapping of their associated handler function */ |
| 243 | static const std::map<std::string, std::map<std::string, propHandler>> |
| 244 | _intfPropHandlers; |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 245 | |
Matthew Barth | de90fb4 | 2021-03-04 16:34:28 -0600 | [diff] [blame] | 246 | /* List of fans included in this zone */ |
| 247 | std::vector<std::unique_ptr<Fan>> _fans; |
| 248 | |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 249 | /** |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 250 | * @brief Parse and set the zone's default ceiling value |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 251 | * |
| 252 | * @param[in] jsonObj - JSON object for the zone |
| 253 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 254 | * Sets the default ceiling value for the zone from the JSON configuration |
| 255 | * object |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 256 | */ |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 257 | void setDefaultCeiling(const json& jsonObj); |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 258 | |
| 259 | /** |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 260 | * @brief Parse and set the zone's default floor value |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 261 | * |
| 262 | * @param[in] jsonObj - JSON object for the zone |
| 263 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 264 | * Sets the default floor value for the zone from the JSON configuration |
| 265 | * object |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 266 | */ |
| 267 | void setDefaultFloor(const json& jsonObj); |
| 268 | |
| 269 | /** |
| 270 | * @brief Parse and set the zone's decrease interval(in seconds) |
| 271 | * |
| 272 | * @param[in] jsonObj - JSON object for the zone |
| 273 | * |
Matthew Barth | e47c958 | 2021-03-09 14:24:02 -0600 | [diff] [blame^] | 274 | * Sets the decrease interval(in seconds) for the zone from the JSON |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 275 | * configuration object |
| 276 | */ |
| 277 | void setDecInterval(const json& jsonObj); |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 278 | |
| 279 | /** |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 280 | * @brief Parse and set the interfaces served by the zone(OPTIONAL) |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 281 | * |
| 282 | * @param[in] jsonObj - JSON object for the zone |
| 283 | * |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 284 | * Constructs any zone interface handler functions for interfaces that the |
| 285 | * zone serves which contains the interface's property's value and |
| 286 | * persistency state (OPTIONAL). A property's "persist" state is defaulted |
| 287 | * to not be persisted when not given. |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 288 | */ |
| 289 | void setInterfaces(const json& jsonObj); |
Matthew Barth | a0dd135 | 2021-03-09 11:10:49 -0600 | [diff] [blame] | 290 | |
| 291 | /** |
| 292 | * @brief Is the property persisted |
| 293 | * |
| 294 | * @param[in] intf - Interface containing property |
| 295 | * @param[in] prop - Property to check if persisted |
| 296 | * |
| 297 | * @return - True if property is to be persisted, false otherwise |
| 298 | */ |
| 299 | bool isPersisted(const std::string& intf, const std::string& prop); |
| 300 | |
| 301 | /** |
| 302 | * @brief Save the thermal control current mode property to persisted |
| 303 | * storage |
| 304 | */ |
| 305 | void saveCurrentMode(); |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 306 | }; |
| 307 | |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 308 | /** |
| 309 | * Properties of interfaces supported by the zone configuration |
| 310 | */ |
| 311 | namespace zone::property |
| 312 | { |
| 313 | |
| 314 | /** |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 315 | * @brief "Supported" property on the "xyz.openbmc_project.Control.ThermalMode" |
| 316 | * interface |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 317 | * |
| 318 | * @param[in] jsonObj - JSON object for the "Supported" property |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 319 | * @param[in] persist - Whether to persist the value or not |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 320 | * |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 321 | * @return Zone interface handler function for the property |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 322 | */ |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 323 | ZoneHandler supported(const json& jsonObj, bool persist); |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 324 | |
| 325 | /** |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 326 | * @brief "Current" property on the "xyz.openbmc_project.Control.ThermalMode" |
| 327 | * interface |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 328 | * |
| 329 | * @param[in] jsonObj - JSON object for the "Current" property |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 330 | * @param[in] persist - Whether to persist the value or not |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 331 | * |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 332 | * @return Zone interface handler function for the property |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 333 | */ |
Matthew Barth | 216229c | 2020-09-24 13:47:33 -0500 | [diff] [blame] | 334 | ZoneHandler current(const json& jsonObj, bool persist); |
Matthew Barth | 651f03a | 2020-08-27 16:15:11 -0500 | [diff] [blame] | 335 | |
| 336 | } // namespace zone::property |
| 337 | |
Matthew Barth | 4f0d3b7 | 2020-08-27 14:32:15 -0500 | [diff] [blame] | 338 | } // namespace phosphor::fan::control::json |