Jim Wright | 10eb00f | 2021-07-21 12:10:38 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2021 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 | |
Jim Wright | 539b608 | 2021-08-02 14:50:23 -0500 | [diff] [blame] | 17 | #include "power_control.hpp" |
| 18 | |
| 19 | #include "types.hpp" |
| 20 | |
| 21 | #include <phosphor-logging/log.hpp> |
| 22 | #include <sdbusplus/bus.hpp> |
| 23 | #include <sdeventplus/event.hpp> |
| 24 | #include <sdeventplus/utility/timer.hpp> |
| 25 | |
| 26 | #include <chrono> |
| 27 | #include <exception> |
| 28 | |
| 29 | using namespace phosphor::logging; |
| 30 | |
| 31 | namespace phosphor::power::sequencer |
Jim Wright | 10eb00f | 2021-07-21 12:10:38 -0500 | [diff] [blame] | 32 | { |
Jim Wright | 539b608 | 2021-08-02 14:50:23 -0500 | [diff] [blame] | 33 | |
| 34 | PowerControl::PowerControl(sdbusplus::bus::bus& bus, |
| 35 | const sdeventplus::Event& event) : |
| 36 | bus{bus}, |
| 37 | eventLoop{event}, timer{event, std::bind(&PowerControl::pollPgood, this), |
| 38 | std::chrono::milliseconds(pollInterval)} |
| 39 | { |
| 40 | // Obtain dbus service name |
| 41 | bus.request_name(POWER_IFACE); |
Jim Wright | 10eb00f | 2021-07-21 12:10:38 -0500 | [diff] [blame] | 42 | } |
Jim Wright | 539b608 | 2021-08-02 14:50:23 -0500 | [diff] [blame] | 43 | |
| 44 | void PowerControl::pollPgood() |
| 45 | { |
| 46 | } |
| 47 | |
| 48 | } // namespace phosphor::power::sequencer |