blob: bd6a72d33b1b7c3e38b321414c45470355fd36f2 [file] [log] [blame]
Vishwanatha Subbanna506aa0f2017-01-24 14:58:25 +05301/**
2 * Copyright © 2016 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 */
Vishwanatha Subbanna7cc9d712017-01-24 18:48:40 +053016#include "softoff.hpp"
Vishwanatha Subbanna506aa0f2017-01-24 14:58:25 +053017namespace phosphor
18{
19namespace ipmi
20{
Vishwanatha Subbanna7cc9d712017-01-24 18:48:40 +053021
22// Need this to send SMS_ATTN
23constexpr auto HOST_IPMI_BUS = "org.openbmc.HostIpmi";
24constexpr auto HOST_IPMI_OBJ = "/org/openbmc/HostIpmi/1";
25constexpr auto HOST_IPMI_INTF = "org.openbmc.HostIpmi";
26
27/** @brief Send the SMS_ATN to host if value is set */
28void SoftPowerOff::sendSMSAttn()
29{
30 auto method = bus.new_method_call(HOST_IPMI_BUS,
31 HOST_IPMI_OBJ,
32 HOST_IPMI_INTF,
33 "setAttention");
34
35 // If there is any exception, would be thrown here.
36 // BT returns '0' on success and bus_error on failure.
37 bus.call_noreply(method);
38
39 return;
40}
Vishwanatha Subbanna506aa0f2017-01-24 14:58:25 +053041} // namespace ipmi
42} // namespace phosphor