Matthew Barth | 29e9e38 | 2020-01-23 13:40:49 -0600 | [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 | |
| 17 | #include "manager.hpp" |
| 18 | |
| 19 | #include <sdbusplus/bus.hpp> |
| 20 | |
| 21 | namespace phosphor |
| 22 | { |
| 23 | namespace power |
| 24 | { |
| 25 | namespace regulators |
| 26 | { |
| 27 | |
| 28 | Manager::Manager(sdbusplus::bus::bus& bus) : |
| 29 | ManagerObject(bus, objPath, true), bus(bus) |
| 30 | { |
| 31 | // TODO get property (IM keyword) |
| 32 | // call parse json function |
| 33 | // TODO subscribe to interfacesadded (IM keyword) |
| 34 | // callback would call parse json function |
| 35 | |
| 36 | // Obtain dbus service name |
| 37 | bus.request_name(busName); |
| 38 | } |
| 39 | |
| 40 | void Manager::configure() |
| 41 | { |
| 42 | // TODO Configuration errors that should halt poweron, |
| 43 | // throw InternalFailure exception (or similar) to |
| 44 | // fail the call(busctl) to this method |
| 45 | } |
| 46 | |
| 47 | void Manager::monitor(bool enable) |
| 48 | { |
| 49 | if (enable) |
| 50 | { |
| 51 | // TODO Enable timer event that will do the monitoring |
| 52 | } |
| 53 | else |
| 54 | { |
| 55 | // TODO Disable/delete timer event to stop monitoring |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | } // namespace regulators |
| 60 | } // namespace power |
| 61 | } // namespace phosphor |