blob: 6ed90f89223b735244b80b1eb7bd5a043cc9fb43 [file] [log] [blame]
Matthew Barth4f0d3b72020-08-27 14:32:15 -05001/**
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 Barthde90fb42021-03-04 16:34:28 -060019#include "fan.hpp"
Matthew Bartha0dd1352021-03-09 11:10:49 -060020#include "xyz/openbmc_project/Control/ThermalMode/server.hpp"
Matthew Barth4f0d3b72020-08-27 14:32:15 -050021
22#include <nlohmann/json.hpp>
Matthew Barthacd737c2021-03-04 11:04:01 -060023#include <sdbusplus/bus.hpp>
Matthew Barth603ef162021-03-24 15:34:53 -050024#include <sdeventplus/event.hpp>
Matthew Barth007de092021-03-25 13:56:04 -050025#include <sdeventplus/utility/timer.hpp>
Matthew Barth4f0d3b72020-08-27 14:32:15 -050026
Matthew Barth651f03a2020-08-27 16:15:11 -050027#include <any>
Matthew Barth007de092021-03-25 13:56:04 -050028#include <chrono>
Matthew Barth651f03a2020-08-27 16:15:11 -050029#include <functional>
30#include <map>
31#include <tuple>
32
Matthew Barth4f0d3b72020-08-27 14:32:15 -050033namespace phosphor::fan::control::json
34{
35
Matthew Barth603ef162021-03-24 15:34:53 -050036class Manager;
37
Matthew Barth4f0d3b72020-08-27 14:32:15 -050038using json = nlohmann::json;
39
Matthew Bartha0dd1352021-03-09 11:10:49 -060040/* Extend the Control::ThermalMode interface */
41using ThermalObject = sdbusplus::server::object::object<
42 sdbusplus::xyz::openbmc_project::Control::server::ThermalMode>;
43
Matthew Barth007de092021-03-25 13:56:04 -050044/* Dbus event timer */
45using Timer = sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>;
46
Matthew Barth4f0d3b72020-08-27 14:32:15 -050047/**
48 * @class Zone - Represents a configured fan control zone
49 *
50 * A zone object contains the configured attributes for a zone that groups
Matthew Barthe47c9582021-03-09 14:24:02 -060051 * a number of fans together to be under the same target control. These
52 * configuration attributes include, but are not limited to, the default ceiling
53 * of the fans within the zone, a default floor, the delay between increases, a
54 * decrease interval, and any profiles(OPTIONAL) the zone should be included in.
Matthew Barth4f0d3b72020-08-27 14:32:15 -050055 *
56 * (When no profile for a zone is given, the zone defaults to always exist)
57 *
58 */
Matthew Bartha0dd1352021-03-09 11:10:49 -060059class Zone : public ConfigBase, public ThermalObject
Matthew Barth4f0d3b72020-08-27 14:32:15 -050060{
61 public:
62 /* JSON file name for zones */
63 static constexpr auto confFileName = "zones.json";
Matthew Barth216229c2020-09-24 13:47:33 -050064 static constexpr auto thermModeIntf =
65 "xyz.openbmc_project.Control.ThermalMode";
66 static constexpr auto supportedProp = "Supported";
67 static constexpr auto currentProp = "Current";
Matthew Barth651f03a2020-08-27 16:15:11 -050068
Matthew Barth4f0d3b72020-08-27 14:32:15 -050069 Zone() = delete;
70 Zone(const Zone&) = delete;
71 Zone(Zone&&) = delete;
72 Zone& operator=(const Zone&) = delete;
73 Zone& operator=(Zone&&) = delete;
74 ~Zone() = default;
75
76 /**
77 * Constructor
78 * Parses and populates a zone from JSON object data
79 *
Matthew Barth4f0d3b72020-08-27 14:32:15 -050080 * @param[in] jsonObj - JSON object
Matthew Barth603ef162021-03-24 15:34:53 -050081 * @param[in] event - sdeventplus event loop
82 * @param[in] mgr - Manager of this zone
Matthew Barth4f0d3b72020-08-27 14:32:15 -050083 */
Matthew Barth9403a212021-05-17 09:31:50 -050084 Zone(const json& jsonObj, const sdeventplus::Event& event, Manager* mgr);
Matthew Barth4f0d3b72020-08-27 14:32:15 -050085
86 /**
Matthew Barthe47c9582021-03-09 14:24:02 -060087 * @brief Get the default ceiling
Matthew Barth4f0d3b72020-08-27 14:32:15 -050088 *
Matthew Barthe47c9582021-03-09 14:24:02 -060089 * Default ceiling is the highest target the fans within this zone is
90 * allowed to increase to. The zone's ceiling defaults to this unless
91 * changed by some configured event.
Matthew Barth4f0d3b72020-08-27 14:32:15 -050092 *
Matthew Barthe47c9582021-03-09 14:24:02 -060093 * @return Default ceiling of this zone
Matthew Barth4f0d3b72020-08-27 14:32:15 -050094 */
Matthew Barthe47c9582021-03-09 14:24:02 -060095 inline const auto& getDefaultCeiling() const
Matthew Barth4f0d3b72020-08-27 14:32:15 -050096 {
Matthew Barthe47c9582021-03-09 14:24:02 -060097 return _defaultCeiling;
Matthew Barth4f0d3b72020-08-27 14:32:15 -050098 }
99
100 /**
Matthew Barthe47c9582021-03-09 14:24:02 -0600101 * @brief Get the default floor
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500102 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600103 * The default floor is the lowest target the fans within this zone
104 * are allowed to decrease to. The zone's floor defaults to this
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500105 * unless changed by some configured event.
106 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600107 * @return Default floor
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500108 */
109 inline const auto& getDefaultFloor() const
110 {
111 return _defaultFloor;
112 }
113
114 /**
Matthew Barthe47c9582021-03-09 14:24:02 -0600115 * @brief Get the increase delay(OPTIONAL)
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500116 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600117 * The increase delay is the amount of time(in seconds) increases
118 * to a target are delayed before being made. The default is 0, which
119 * results in immediate increase requests when any events result in
120 * a change to the target.
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500121 *
122 * It is recommend a value other than 0 is configured, but that inherently
Matthew Barthe47c9582021-03-09 14:24:02 -0600123 * depends on the fan controller and configured increases.
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500124 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600125 * @return Increase delay(in seconds)
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500126 */
127 inline const auto& getIncDelay() const
128 {
129 return _incDelay;
130 }
131
132 /**
Matthew Barthe47c9582021-03-09 14:24:02 -0600133 * @brief Get the decrease interval
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500134 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600135 * Decreases happen on a set interval when no requests for an increase
136 * in fan targets exists. This is the interval(in seconds) at which the fans
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500137 * within the zone are decreased if events exist that result in a target
Matthew Barthe47c9582021-03-09 14:24:02 -0600138 * decrease.
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500139 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600140 * @return Decrease interval(in seconds)
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500141 */
142 inline const auto& getDecInterval() const
143 {
144 return _decInterval;
145 }
146
Matthew Barth651f03a2020-08-27 16:15:11 -0500147 /**
Matthew Barth6f787302021-03-25 15:01:01 -0500148 * @brief Get the current target of the zone
149 *
150 * @return - The current target of the zone
151 */
152 inline const auto& getTarget() const
153 {
154 return _target;
155 }
156
157 /**
Matthew Barthdc776c82021-02-25 16:06:16 -0600158 * @brief Get the target increase delta
159 *
160 * @return - The current target increase delta
161 */
162 inline auto& getIncDelta() const
163 {
164 return _incDelta;
165 };
166
167 /**
Matthew Barth45c44ea2021-03-03 13:16:14 -0600168 * @brief Get the target decrease delta
169 *
170 * @return - The current target decrease delta
171 */
172 inline auto& getDecDelta() const
173 {
174 return _decDelta;
175 };
176
177 /**
Matthew Barth603ef162021-03-24 15:34:53 -0500178 * @brief Get the manager of the zone
179 *
180 * @return - The manager of the zone
181 */
182 inline auto* getManager() const
183 {
184 return _manager;
185 }
186
187 /**
Matthew Barth14303a42021-05-21 13:04:08 -0500188 * @brief Enable the zone
189 *
190 * Performs the necessary tasks to enable the zone such as restoring any
191 * dbus property states(if persisted), starting the decrement timer, etc...
192 */
193 void enable();
194
195 /**
Matthew Barthde90fb42021-03-04 16:34:28 -0600196 * @brief Add a fan object to the zone
197 *
198 * @param[in] fan - Unique pointer to a fan object that will be moved into
199 * the zone
200 *
201 * Adds a fan object to the list of fans that make up the zone by moving the
202 * fan object into the list.
203 */
204 void addFan(std::unique_ptr<Fan> fan);
205
Matthew Barth12cb1252021-03-08 16:47:30 -0600206 /**
Matthew Barth8ba715e2021-03-05 09:00:05 -0600207 * Sets all fans in the zone to the target given when the zone is active
208 *
209 * @param[in] target - Target for fans
210 */
211 void setTarget(uint64_t target);
212
213 /**
214 * @brief Sets the automatic fan control allowed active state
215 *
216 * @param[in] ident - An identifier that affects the active state
217 * @param[in] isActiveAllow - Active state according to group
218 */
219 void setActiveAllow(const std::string& ident, bool isActiveAllow);
220
221 /**
Matthew Barth12cb1252021-03-08 16:47:30 -0600222 * @brief Set the floor to the given target and increase target to the floor
223 * when the target is below the floor value when floor changes are allowed.
224 *
225 * @param[in] target - Target to set the floor to
226 */
227 void setFloor(uint64_t target);
228
229 /**
230 * @brief Sets the floor change allowed state
231 *
232 * @param[in] ident - An identifier that affects floor changes
233 * @param[in] isAllow - Allow state according to the identifier
234 */
235 inline void setFloorChangeAllow(const std::string& ident, bool isAllow)
236 {
237 _floorChange[ident] = isAllow;
238 }
239
240 /**
Matthew Barth45c44ea2021-03-03 13:16:14 -0600241 * @brief Sets the decrease allowed state of a group
242 *
243 * @param[in] ident - An identifier that affects speed decreases
244 * @param[in] isAllow - Allow state according to the identifier
245 */
246 inline void setDecreaseAllow(const std::string& ident, bool isAllow)
247 {
248 _decAllowed[ident] = isAllow;
249 }
250
251 /**
Matthew Barth12cb1252021-03-08 16:47:30 -0600252 * @brief Calculate the requested target from the given delta and increases
253 * the fans, not going above the ceiling.
254 *
255 * @param[in] targetDelta - The delta to increase the target by
256 */
257 void requestIncrease(uint64_t targetDelta);
258
Matthew Bartha0dd1352021-03-09 11:10:49 -0600259 /**
Matthew Barth007de092021-03-25 13:56:04 -0500260 * @brief Callback function for the increase timer that delays
261 * processing of requested target increases while fans are increasing
262 */
263 void incTimerExpired();
264
265 /**
Matthew Barth45c44ea2021-03-03 13:16:14 -0600266 * @brief Calculate the lowest requested decrease target from the given
267 * delta within a decrease interval.
268 *
269 * @param[in] targetDelta - The delta to decrease the target by
270 */
271 void requestDecrease(uint64_t targetDelta);
272
273 /**
Matthew Barth007de092021-03-25 13:56:04 -0500274 * @brief Callback function for the decrease timer that processes any
275 * requested target decreases if allowed
276 */
277 void decTimerExpired();
278
279 /**
Matthew Barth07fecfc2021-01-29 09:04:43 -0600280 * @brief Set the requested target base to be used as the target to base a
281 * new requested target from
282 *
283 * @param[in] targetBase - Base target value to use
284 */
285 inline void setRequestTargetBase(uint64_t targetBase)
286 {
287 _requestTargetBase = targetBase;
288 };
289
290 /**
Matthew Bartha0dd1352021-03-09 11:10:49 -0600291 * @brief Set a property to be persisted
292 *
293 * @param[in] intf - Interface containing property
294 * @param[in] prop - Property to be persisted
295 */
296 void setPersisted(const std::string& intf, const std::string& prop);
297
298 /**
299 * @brief Overridden thermal object's set 'Current' property function
300 *
301 * @param[in] value - Value to set 'Current' to
302 *
303 * @return - The updated value of the 'Current' property
304 */
305 std::string current(std::string value) override;
306
Matthew Barthb584d812021-03-11 15:55:04 -0600307 /**
308 * @brief A handler function to set/update a property on a zone
309 * @details Sets or updates a zone's dbus property to the given value using
310 * the provided base dbus object's set property function
311 *
312 * @param[in] intf - Interface on zone object
313 * @param[in] prop - Property on interface
314 * @param[in] func - Zone object's set property function pointer
315 * @param[in] value - Value to set property to
316 * @param[in] persist - Persist property value or not
317 *
318 * @return Lambda function
319 * A lambda function to set/update the zone's dbus property
320 */
321 template <typename T>
322 static auto setProperty(const char* intf, const char* prop,
323 T (Zone::*func)(T), T&& value, bool persist)
324 {
325 return [=, value = std::forward<T>(value)](Zone* zone) {
326 (zone->*func)(value);
327 if (persist)
328 {
329 zone->setPersisted(intf, prop);
330 }
331 };
332 }
333
334 /**
335 * @brief A handler function to set/update a zone's dbus property's persist
336 * state
337 * @details Sets or updates a zone's dbus property's persist state where the
338 * value of the property is to be left unchanged
339 *
340 * @param[in] intf - Interface on zone object
341 * @param[in] prop - Property on interface
342 * @param[in] persist - Persist property value or not
343 *
344 * @return Lambda function
345 * A lambda function to set/update the zone's dbus property's persist
346 * state
347 */
348 static auto setPropertyPersist(const char* intf, const char* prop,
349 bool persist)
350 {
351 return [=](Zone* zone) {
352 if (persist)
353 {
354 zone->setPersisted(intf, prop);
355 }
356 };
357 }
358
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500359 private:
Matthew Barth603ef162021-03-24 15:34:53 -0500360 /* The zone's manager */
361 Manager* _manager;
362
Matthew Barthe47c9582021-03-09 14:24:02 -0600363 /* The zone's default ceiling value for fans */
364 uint64_t _defaultCeiling;
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500365
Matthew Barthe47c9582021-03-09 14:24:02 -0600366 /* The zone's default floor value for fans */
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500367 uint64_t _defaultFloor;
368
Matthew Barthe47c9582021-03-09 14:24:02 -0600369 /* Zone's increase delay(in seconds) (OPTIONAL) */
Matthew Barth007de092021-03-25 13:56:04 -0500370 std::chrono::seconds _incDelay;
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500371
Matthew Barthe47c9582021-03-09 14:24:02 -0600372 /* Zone's decrease interval(in seconds) */
Matthew Barth007de092021-03-25 13:56:04 -0500373 std::chrono::seconds _decInterval;
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500374
Matthew Barth12cb1252021-03-08 16:47:30 -0600375 /* The floor target to not go below */
376 uint64_t _floor;
377
378 /* Target for this zone */
379 uint64_t _target;
380
Matthew Barth2b3253e2021-03-09 14:51:16 -0600381 /* Zone increase delta */
382 uint64_t _incDelta;
383
Matthew Barth45c44ea2021-03-03 13:16:14 -0600384 /* Zone decrease delta */
385 uint64_t _decDelta;
386
Matthew Barth2b3253e2021-03-09 14:51:16 -0600387 /* The ceiling target to not go above */
388 uint64_t _ceiling;
389
390 /* Requested target base */
391 uint64_t _requestTargetBase;
392
Matthew Barth12cb1252021-03-08 16:47:30 -0600393 /* Map of whether floor changes are allowed by a string identifier */
394 std::map<std::string, bool> _floorChange;
395
Matthew Barth45c44ea2021-03-03 13:16:14 -0600396 /* Map of controlling decreases allowed by a string identifer */
397 std::map<std::string, bool> _decAllowed;
398
Matthew Bartha0dd1352021-03-09 11:10:49 -0600399 /* Map of interfaces to persisted properties the zone hosts*/
400 std::map<std::string, std::vector<std::string>> _propsPersisted;
401
Matthew Barth8ba715e2021-03-05 09:00:05 -0600402 /* Automatic fan control active state */
403 bool _isActive;
404
Matthew Barth007de092021-03-25 13:56:04 -0500405 /* The target increase timer object */
406 Timer _incTimer;
407
408 /* The target decrease timer object */
409 Timer _decTimer;
410
Matthew Barth8ba715e2021-03-05 09:00:05 -0600411 /* Map of active fan control allowed by a string identifier */
412 std::map<std::string, bool> _active;
413
Matthew Barthb584d812021-03-11 15:55:04 -0600414 /* Interface to property mapping of their associated set property handler
415 * function */
416 static const std::map<
417 std::string,
418 std::map<std::string,
419 std::function<std::function<void(Zone*)>(const json&, bool)>>>
Matthew Barth216229c2020-09-24 13:47:33 -0500420 _intfPropHandlers;
Matthew Barth651f03a2020-08-27 16:15:11 -0500421
Matthew Barthde90fb42021-03-04 16:34:28 -0600422 /* List of fans included in this zone */
423 std::vector<std::unique_ptr<Fan>> _fans;
424
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500425 /**
Matthew Barthe47c9582021-03-09 14:24:02 -0600426 * @brief Parse and set the zone's default ceiling value
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500427 *
428 * @param[in] jsonObj - JSON object for the zone
429 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600430 * Sets the default ceiling value for the zone from the JSON configuration
431 * object
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500432 */
Matthew Barthe47c9582021-03-09 14:24:02 -0600433 void setDefaultCeiling(const json& jsonObj);
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500434
435 /**
Matthew Barthe47c9582021-03-09 14:24:02 -0600436 * @brief Parse and set the zone's default floor value
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500437 *
438 * @param[in] jsonObj - JSON object for the zone
439 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600440 * Sets the default floor value for the zone from the JSON configuration
441 * object
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500442 */
443 void setDefaultFloor(const json& jsonObj);
444
445 /**
446 * @brief Parse and set the zone's decrease interval(in seconds)
447 *
448 * @param[in] jsonObj - JSON object for the zone
449 *
Matthew Barthe47c9582021-03-09 14:24:02 -0600450 * Sets the decrease interval(in seconds) for the zone from the JSON
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500451 * configuration object
452 */
453 void setDecInterval(const json& jsonObj);
Matthew Barth651f03a2020-08-27 16:15:11 -0500454
455 /**
Matthew Barth216229c2020-09-24 13:47:33 -0500456 * @brief Parse and set the interfaces served by the zone(OPTIONAL)
Matthew Barth651f03a2020-08-27 16:15:11 -0500457 *
458 * @param[in] jsonObj - JSON object for the zone
459 *
Matthew Barth216229c2020-09-24 13:47:33 -0500460 * Constructs any zone interface handler functions for interfaces that the
461 * zone serves which contains the interface's property's value and
462 * persistency state (OPTIONAL). A property's "persist" state is defaulted
463 * to not be persisted when not given.
Matthew Barth651f03a2020-08-27 16:15:11 -0500464 */
465 void setInterfaces(const json& jsonObj);
Matthew Bartha0dd1352021-03-09 11:10:49 -0600466
467 /**
468 * @brief Is the property persisted
469 *
470 * @param[in] intf - Interface containing property
471 * @param[in] prop - Property to check if persisted
472 *
473 * @return - True if property is to be persisted, false otherwise
474 */
475 bool isPersisted(const std::string& intf, const std::string& prop);
476
477 /**
478 * @brief Save the thermal control current mode property to persisted
479 * storage
480 */
481 void saveCurrentMode();
Matthew Barth2b3253e2021-03-09 14:51:16 -0600482
483 /**
Matthew Bartha4483742021-03-25 14:09:01 -0500484 * @brief Restore persisted thermal control current mode property
485 * value, setting the mode to "Default" otherwise
486 */
487 void restoreCurrentMode();
488
489 /**
Matthew Barth2b3253e2021-03-09 14:51:16 -0600490 * @brief Get the request target base if defined, otherwise the the current
491 * target is returned
492 *
493 * @return - The request target base or current target
494 */
495 inline auto getRequestTargetBase() const
496 {
497 return (_requestTargetBase != 0) ? _requestTargetBase : _target;
498 };
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500499};
500
Matthew Barth651f03a2020-08-27 16:15:11 -0500501/**
502 * Properties of interfaces supported by the zone configuration
503 */
504namespace zone::property
505{
506
507/**
Matthew Barth216229c2020-09-24 13:47:33 -0500508 * @brief "Supported" property on the "xyz.openbmc_project.Control.ThermalMode"
Matthew Barthb584d812021-03-11 15:55:04 -0600509 * interface parser. Also creates the handler function for the Zone object to
510 * initialize the property according to what's parsed from the configuration.
Matthew Barth651f03a2020-08-27 16:15:11 -0500511 *
512 * @param[in] jsonObj - JSON object for the "Supported" property
Matthew Barth216229c2020-09-24 13:47:33 -0500513 * @param[in] persist - Whether to persist the value or not
Matthew Barth651f03a2020-08-27 16:15:11 -0500514 *
Matthew Barthb584d812021-03-11 15:55:04 -0600515 * @return Zone interface set property handler function for the "Supported"
516 * property
Matthew Barth651f03a2020-08-27 16:15:11 -0500517 */
Matthew Barthb584d812021-03-11 15:55:04 -0600518std::function<void(Zone*)> supported(const json& jsonObj, bool persist);
Matthew Barth651f03a2020-08-27 16:15:11 -0500519
520/**
Matthew Barth216229c2020-09-24 13:47:33 -0500521 * @brief "Current" property on the "xyz.openbmc_project.Control.ThermalMode"
Matthew Barthb584d812021-03-11 15:55:04 -0600522 * interface parser. Also creates the handler function for the Zone object to
523 * initialize the property according to what's parsed from the configuration.
Matthew Barth651f03a2020-08-27 16:15:11 -0500524 *
525 * @param[in] jsonObj - JSON object for the "Current" property
Matthew Barth216229c2020-09-24 13:47:33 -0500526 * @param[in] persist - Whether to persist the value or not
Matthew Barth651f03a2020-08-27 16:15:11 -0500527 *
Matthew Barthb584d812021-03-11 15:55:04 -0600528 * @return Zone interface set property handler function for the "Current"
529 * property
Matthew Barth651f03a2020-08-27 16:15:11 -0500530 */
Matthew Barthb584d812021-03-11 15:55:04 -0600531std::function<void(Zone*)> current(const json& jsonObj, bool persist);
Matthew Barth651f03a2020-08-27 16:15:11 -0500532
533} // namespace zone::property
534
Matthew Barth4f0d3b72020-08-27 14:32:15 -0500535} // namespace phosphor::fan::control::json