diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-01-24 18:48:40 +0530 |
---|---|---|
committer | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-03-22 11:15:13 +0530 |
commit | 7cc9d716a4880c14f6a7882c25d920ce7cd77cd4 (patch) | |
tree | 0facea3c8be4b756bff38de3b5c75852b39ca4cd /softoff/softoff.cpp | |
parent | 506aa0f33362eee06a8f7a2572519d4053f06e41 (diff) | |
download | phosphor-host-ipmid-7cc9d716a4880c14f6a7882c25d920ce7cd77cd4.tar.gz phosphor-host-ipmid-7cc9d716a4880c14f6a7882c25d920ce7cd77cd4.zip |
Add function to send SMS_ATTN to host
This patch overrides one of the base API and sends a message that
enables the current HOST IPMI BT provider to actually set the SMS_ATTN.
Change-Id: I250ea6bed99e569e493251f6fc298aa7ed7c776f
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'softoff/softoff.cpp')
-rw-r--r-- | softoff/softoff.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp index 3505e5a..bd6a72d 100644 --- a/softoff/softoff.cpp +++ b/softoff/softoff.cpp @@ -13,10 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "softoff.hpp" namespace phosphor { namespace ipmi { - // Will be populated in the next patchset. + +// Need this to send SMS_ATTN +constexpr auto HOST_IPMI_BUS = "org.openbmc.HostIpmi"; +constexpr auto HOST_IPMI_OBJ = "/org/openbmc/HostIpmi/1"; +constexpr auto HOST_IPMI_INTF = "org.openbmc.HostIpmi"; + +/** @brief Send the SMS_ATN to host if value is set */ +void SoftPowerOff::sendSMSAttn() +{ + auto method = bus.new_method_call(HOST_IPMI_BUS, + HOST_IPMI_OBJ, + HOST_IPMI_INTF, + "setAttention"); + + // If there is any exception, would be thrown here. + // BT returns '0' on success and bus_error on failure. + bus.call_noreply(method); + + return; +} } // namespace ipmi } // namespace phosphor |