Matthew Barth | d87f89f | 2020-07-30 10:41:32 -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 | #include "json_parser.hpp" |
| 17 | |
Matthew Barth | a227a16 | 2020-08-05 10:51:45 -0500 | [diff] [blame] | 18 | #include "json/manager.hpp" |
Matthew Barth | 2331d18 | 2020-08-18 15:00:27 -0500 | [diff] [blame^] | 19 | #include "json/profile.hpp" |
Matthew Barth | 23ac24c | 2020-08-04 13:55:43 -0500 | [diff] [blame] | 20 | #include "types.hpp" |
| 21 | |
| 22 | #include <sdbusplus/bus.hpp> |
| 23 | |
Matthew Barth | d87f89f | 2020-07-30 10:41:32 -0500 | [diff] [blame] | 24 | namespace phosphor::fan::control |
Matthew Barth | 23ac24c | 2020-08-04 13:55:43 -0500 | [diff] [blame] | 25 | { |
| 26 | |
| 27 | const std::vector<ZoneGroup> getZoneGroups(sdbusplus::bus::bus& bus) |
| 28 | { |
| 29 | std::vector<ZoneGroup> zoneGrps; |
| 30 | |
Matthew Barth | 2331d18 | 2020-08-18 15:00:27 -0500 | [diff] [blame^] | 31 | // 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 Barth | 23ac24c | 2020-08-04 13:55:43 -0500 | [diff] [blame] | 36 | return zoneGrps; |
| 37 | } |
| 38 | |
Matthew Barth | 2dc5aba | 2020-08-04 14:23:34 -0500 | [diff] [blame] | 39 | const unsigned int getPowerOnDelay(sdbusplus::bus::bus& bus) |
| 40 | { |
Matthew Barth | a227a16 | 2020-08-05 10:51:45 -0500 | [diff] [blame] | 41 | json::Manager mgr{bus}; |
| 42 | return mgr.getPowerOnDelay(); |
Matthew Barth | 2dc5aba | 2020-08-04 14:23:34 -0500 | [diff] [blame] | 43 | } |
| 44 | |
Matthew Barth | 23ac24c | 2020-08-04 13:55:43 -0500 | [diff] [blame] | 45 | } // namespace phosphor::fan::control |