Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 1 | /** |
| 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 Subbanna | 7cc9d71 | 2017-01-24 18:48:40 +0530 | [diff] [blame^] | 16 | #include "softoff.hpp" |
Vishwanatha Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 17 | namespace phosphor |
| 18 | { |
| 19 | namespace ipmi |
| 20 | { |
Vishwanatha Subbanna | 7cc9d71 | 2017-01-24 18:48:40 +0530 | [diff] [blame^] | 21 | |
| 22 | // Need this to send SMS_ATTN |
| 23 | constexpr auto HOST_IPMI_BUS = "org.openbmc.HostIpmi"; |
| 24 | constexpr auto HOST_IPMI_OBJ = "/org/openbmc/HostIpmi/1"; |
| 25 | constexpr auto HOST_IPMI_INTF = "org.openbmc.HostIpmi"; |
| 26 | |
| 27 | /** @brief Send the SMS_ATN to host if value is set */ |
| 28 | void 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 Subbanna | 506aa0f | 2017-01-24 14:58:25 +0530 | [diff] [blame] | 41 | } // namespace ipmi |
| 42 | } // namespace phosphor |