1*29e9e385SMatthew Barth /**
2*29e9e385SMatthew Barth  * Copyright © 2020 IBM Corporation
3*29e9e385SMatthew Barth  *
4*29e9e385SMatthew Barth  * Licensed under the Apache License, Version 2.0 (the "License");
5*29e9e385SMatthew Barth  * you may not use this file except in compliance with the License.
6*29e9e385SMatthew Barth  * You may obtain a copy of the License at
7*29e9e385SMatthew Barth  *
8*29e9e385SMatthew Barth  *     http://www.apache.org/licenses/LICENSE-2.0
9*29e9e385SMatthew Barth  *
10*29e9e385SMatthew Barth  * Unless required by applicable law or agreed to in writing, software
11*29e9e385SMatthew Barth  * distributed under the License is distributed on an "AS IS" BASIS,
12*29e9e385SMatthew Barth  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*29e9e385SMatthew Barth  * See the License for the specific language governing permissions and
14*29e9e385SMatthew Barth  * limitations under the License.
15*29e9e385SMatthew Barth  */
16*29e9e385SMatthew Barth 
17*29e9e385SMatthew Barth #include "manager.hpp"
18*29e9e385SMatthew Barth 
19*29e9e385SMatthew Barth #include <sdbusplus/bus.hpp>
20*29e9e385SMatthew Barth 
21*29e9e385SMatthew Barth namespace phosphor
22*29e9e385SMatthew Barth {
23*29e9e385SMatthew Barth namespace power
24*29e9e385SMatthew Barth {
25*29e9e385SMatthew Barth namespace regulators
26*29e9e385SMatthew Barth {
27*29e9e385SMatthew Barth 
28*29e9e385SMatthew Barth Manager::Manager(sdbusplus::bus::bus& bus) :
29*29e9e385SMatthew Barth     ManagerObject(bus, objPath, true), bus(bus)
30*29e9e385SMatthew Barth {
31*29e9e385SMatthew Barth     // TODO get property (IM keyword)
32*29e9e385SMatthew Barth     // call parse json function
33*29e9e385SMatthew Barth     // TODO subscribe to interfacesadded (IM keyword)
34*29e9e385SMatthew Barth     // callback would call parse json function
35*29e9e385SMatthew Barth 
36*29e9e385SMatthew Barth     // Obtain dbus service name
37*29e9e385SMatthew Barth     bus.request_name(busName);
38*29e9e385SMatthew Barth }
39*29e9e385SMatthew Barth 
40*29e9e385SMatthew Barth void Manager::configure()
41*29e9e385SMatthew Barth {
42*29e9e385SMatthew Barth     // TODO Configuration errors that should halt poweron,
43*29e9e385SMatthew Barth     // throw InternalFailure exception (or similar) to
44*29e9e385SMatthew Barth     // fail the call(busctl) to this method
45*29e9e385SMatthew Barth }
46*29e9e385SMatthew Barth 
47*29e9e385SMatthew Barth void Manager::monitor(bool enable)
48*29e9e385SMatthew Barth {
49*29e9e385SMatthew Barth     if (enable)
50*29e9e385SMatthew Barth     {
51*29e9e385SMatthew Barth         // TODO Enable timer event that will do the monitoring
52*29e9e385SMatthew Barth     }
53*29e9e385SMatthew Barth     else
54*29e9e385SMatthew Barth     {
55*29e9e385SMatthew Barth         // TODO Disable/delete timer event to stop monitoring
56*29e9e385SMatthew Barth     }
57*29e9e385SMatthew Barth }
58*29e9e385SMatthew Barth 
59*29e9e385SMatthew Barth } // namespace regulators
60*29e9e385SMatthew Barth } // namespace power
61*29e9e385SMatthew Barth } // namespace phosphor
62