blob: 9b807067071c97bf3a4ef094eae914ec3a0cd268 [file] [log] [blame]
Matthew Barthd87f89f2020-07-30 10:41:32 -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#include "json_parser.hpp"
17
Matthew Bartha227a162020-08-05 10:51:45 -050018#include "json/manager.hpp"
Matthew Barth2331d182020-08-18 15:00:27 -050019#include "json/profile.hpp"
Matthew Barth23ac24c2020-08-04 13:55:43 -050020#include "types.hpp"
21
22#include <sdbusplus/bus.hpp>
23
Matthew Barthd87f89f2020-07-30 10:41:32 -050024namespace phosphor::fan::control
Matthew Barth23ac24c2020-08-04 13:55:43 -050025{
26
27const std::vector<ZoneGroup> getZoneGroups(sdbusplus::bus::bus& bus)
28{
29 std::vector<ZoneGroup> zoneGrps;
30
Matthew Barth2331d182020-08-18 15:00:27 -050031 // Profiles are optional
32 auto profiles = getConfig<json::Profile>(bus, true);
33
34 // TODO Create zone groups after loading all JSON config files
35
Matthew Barth23ac24c2020-08-04 13:55:43 -050036 return zoneGrps;
37}
38
Matthew Barth2dc5aba2020-08-04 14:23:34 -050039const unsigned int getPowerOnDelay(sdbusplus::bus::bus& bus)
40{
Matthew Bartha227a162020-08-05 10:51:45 -050041 json::Manager mgr{bus};
42 return mgr.getPowerOnDelay();
Matthew Barth2dc5aba2020-08-04 14:23:34 -050043}
44
Matthew Barth23ac24c2020-08-04 13:55:43 -050045} // namespace phosphor::fan::control