blob: 2699571660e292438d5d8bc2dbd30fea0999d846 [file] [log] [blame]
Cheng C Yangeecaf822019-12-19 00:34:23 +08001/*
Zhikui Ren18a5ab92020-09-01 21:35:20 -07002// Copyright (c) 2018 Intel Corporation
Cheng C Yangeecaf822019-12-19 00:34:23 +08003//
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 "mdrv2.hpp"
18
Zhikui Ren18a5ab92020-09-01 21:35:20 -070019#include <boost/asio/io_context.hpp>
Cheng C Yangeecaf822019-12-19 00:34:23 +080020#include <phosphor-logging/elog-errors.hpp>
21#include <phosphor-logging/elog.hpp>
Zhikui Ren18a5ab92020-09-01 21:35:20 -070022#include <sdbusplus/asio/connection.hpp>
23#include <sdbusplus/asio/object_server.hpp>
24
25boost::asio::io_context io;
26auto connection = std::make_shared<sdbusplus::asio::connection>(io);
27auto objServer = sdbusplus::asio::object_server(connection);
28
29sdbusplus::asio::object_server& getObjectServer(void)
30{
31 return objServer;
32}
Cheng C Yangeecaf822019-12-19 00:34:23 +080033
34int main(void)
35{
Zhikui Ren18a5ab92020-09-01 21:35:20 -070036 sdbusplus::bus::bus& bus = static_cast<sdbusplus::bus::bus&>(*connection);
Cheng C Yangeecaf822019-12-19 00:34:23 +080037 sdbusplus::server::manager::manager objManager(
38 bus, "/xyz/openbmc_project/inventory");
Zhikui Ren18a5ab92020-09-01 21:35:20 -070039
Cheng C Yangeecaf822019-12-19 00:34:23 +080040 bus.request_name("xyz.openbmc_project.Smbios.MDR_V2");
41
Zhikui Ren18a5ab92020-09-01 21:35:20 -070042 phosphor::smbios::MDR_V2 mdrV2(bus, phosphor::smbios::mdrV2Path, io);
Cheng C Yangeecaf822019-12-19 00:34:23 +080043
Zhikui Ren18a5ab92020-09-01 21:35:20 -070044 io.run();
45
Cheng C Yangeecaf822019-12-19 00:34:23 +080046 return 0;
47}