17136a5aeSJames Feist /* 27136a5aeSJames Feist // Copyright (c) 2018 Intel Corporation 37136a5aeSJames Feist // 47136a5aeSJames Feist // Licensed under the Apache License, Version 2.0 (the "License"); 57136a5aeSJames Feist // you may not use this file except in compliance with the License. 67136a5aeSJames Feist // You may obtain a copy of the License at 77136a5aeSJames Feist // 87136a5aeSJames Feist // http://www.apache.org/licenses/LICENSE-2.0 97136a5aeSJames Feist // 107136a5aeSJames Feist // Unless required by applicable law or agreed to in writing, software 117136a5aeSJames Feist // distributed under the License is distributed on an "AS IS" BASIS, 127136a5aeSJames Feist // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 137136a5aeSJames Feist // See the License for the specific language governing permissions and 147136a5aeSJames Feist // limitations under the License. 157136a5aeSJames Feist */ 167136a5aeSJames Feist #pragma once 177e952d9fSPatrick Venture 180771659eSPatrick Venture #include "conf.hpp" 190771659eSPatrick Venture 207f837e05SPatrick Venture #include <boost/asio/steady_timer.hpp> 217136a5aeSJames Feist #include <sdbusplus/bus.hpp> 227136a5aeSJames Feist 237e952d9fSPatrick Venture #include <cstdint> 247382318fSPatrick Venture #include <map> 257e952d9fSPatrick Venture #include <string> 267e952d9fSPatrick Venture #include <unordered_map> 277e952d9fSPatrick Venture #include <variant> 287e952d9fSPatrick Venture #include <vector> 297e952d9fSPatrick Venture 307e952d9fSPatrick Venture using DbusVariantType = 318f73ad76SAlex.Song std::variant<uint64_t, int64_t, double, std::string, bool, 327e952d9fSPatrick Venture std::vector<std::string>, std::vector<double>>; 337e952d9fSPatrick Venture 347e952d9fSPatrick Venture using ManagedObjectType = std::unordered_map< 357e952d9fSPatrick Venture sdbusplus::message::object_path, 367e952d9fSPatrick Venture std::unordered_map<std::string, 377e952d9fSPatrick Venture std::unordered_map<std::string, DbusVariantType>>>; 387e952d9fSPatrick Venture 39a076487aSPatrick Venture namespace pid_control 40a076487aSPatrick Venture { 417136a5aeSJames Feist namespace dbus_configuration 427136a5aeSJames Feist { 437382318fSPatrick Venture 447382318fSPatrick Venture /** 457382318fSPatrick Venture * Initialize a dbus-based configuration. 467382318fSPatrick Venture * 477382318fSPatrick Venture * @param bus - the sdbusplus connection to use 487382318fSPatrick Venture * @param timer - the timer to use 497382318fSPatrick Venture * @param sensorConfig - The configuration converted sensor list. 507382318fSPatrick Venture * @param zoneConfig - The configuration converted PID list. 517382318fSPatrick Venture * @param zoneDetailsConfig - The configuration converted Zone configuration. 527382318fSPatrick Venture */ 53*b228bc30SPatrick Williams bool init(sdbusplus::bus_t& bus, boost::asio::steady_timer& timer, 547382318fSPatrick Venture std::map<std::string, conf::SensorConfig>& sensorConfig, 557382318fSPatrick Venture std::map<int64_t, conf::PIDConf>& zoneConfig, 567382318fSPatrick Venture std::map<int64_t, conf::ZoneConfig>& zoneDetailsConfig); 577382318fSPatrick Venture 587136a5aeSJames Feist } // namespace dbus_configuration 59a076487aSPatrick Venture } // namespace pid_control 60