blob: 1e960ae3c916fed6b4bfa67e3a95039505118fe1 [file] [log] [blame]
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +00001/*
2// Copyright (c) 2020 Intel 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
Patrick Williams5c7e80d2024-10-18 21:24:12 -040017#include "config.hpp"
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000018#include "manager.hpp"
19#include "password.hpp"
20
21#include <boost/asio.hpp>
22#include <phosphor-logging/elog-errors.hpp>
23#include <phosphor-logging/lg2.hpp>
24#include <sdbusplus/asio/connection.hpp>
25#include <sdbusplus/asio/object_server.hpp>
26
Patrick Williams773c9222024-10-18 21:39:55 -040027PHOSPHOR_LOG2_USING;
28
29int main(int argc, char** argv)
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000030{
Patrick Williams773c9222024-10-18 21:39:55 -040031 std::string persistPath = BIOS_PERSIST_PATH;
32 if (argc >= 2)
33 {
34 persistPath = argv[1];
35 info("Using temporary path {PATH}", "PATH", persistPath);
36 }
37
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000038 boost::asio::io_service io;
39 auto systemBus = std::make_shared<sdbusplus::asio::connection>(io);
40
41 systemBus->request_name(bios_config::service);
42 sdbusplus::asio::object_server objectServer(systemBus);
43
44 /**
yes8de46ff2023-03-22 14:51:28 +053045 * Manager class is responsible for handling methods and signals under
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000046 * the following object path and interface.
47 *
48 * Object path : /xyz/openbmc_project/bios_config/manager
49 * Interface : xyz.openbmc_project.BIOSConfig.Manager
50 */
Patrick Williams773c9222024-10-18 21:39:55 -040051 bios_config::Manager manager(objectServer, systemBus, persistPath);
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000052
53 /**
yes8de46ff2023-03-22 14:51:28 +053054 * Password class is responsible for handling methods and signals under
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000055 * the following object path and interface.
56 *
57 * Object path : /xyz/openbmc_project/bios_config/password
58 * Interface : xyz.openbmc_project.BIOSConfig.Password
59 */
Patrick Williams773c9222024-10-18 21:39:55 -040060 bios_config_pwd::Password password(objectServer, systemBus, persistPath);
Arun Lal K M1a1dfbd2023-01-17 06:38:19 +000061
62 io.run();
63 return 0;
64}