blob: 293cc0c415e4acb273d5bb08e3ee4800f51610e7 [file] [log] [blame]
Vishwanatha Subbannaac149a92017-07-11 18:16:50 +05301#pragma once
2
Brad Bishop2e12a312018-02-21 13:14:38 -05003#include <functional>
Vishwanatha Subbannaac149a92017-07-11 18:16:50 +05304#include <unistd.h>
5#include <tuple>
6
7namespace phosphor
8{
9namespace host
10{
11namespace command
12{
13 /** @detail After sending SMS_ATN to the Host, Host comes down and
14 * asks why an 'SMS_ATN` was sent.
Gunnar Mills8991dd62017-10-25 17:11:29 -050015 * BMC then sends 'There is a Message to be Read` as response.
Vishwanatha Subbannaac149a92017-07-11 18:16:50 +053016 * Host then comes down asks for Message and the specified
17 * commands and data would go as data conforming to IPMI spec.
18 *
19 * Refer: 6.13.2 Send Message Command From System Interface
20 * in IPMI V2.0 spec.
21 */
22
23 /** @brief IPMI command */
24 using IPMIcmd = uint8_t;
25
26 /** @brief Data associated with command */
27 using Data = uint8_t;
28
29 /** @brief <IPMI command, Data> to be sent as payload when Host asks for
30 * the message that can be associated with the previous SMS_ATN
31 */
32 using IpmiCmdData = std::pair<IPMIcmd, Data>;
33
34 /** @detail Implementation specific callback function to be invoked
35 * conveying the status of the executed command. Specific
36 * implementations may then broadcast an agreed signal
37 */
38 using CallBack = std::function<void(IpmiCmdData, bool)>;
39
40 /** @detail Tuple encapsulating above 2 to enable using Manager by
41 * different implementations. Users of Manager will supply
42 * <Ipmi command, Data> along with the callback handler.
43 * Manager will invoke the handler onveying the status of
44 * the command.
45 */
46 using CommandHandler = std::tuple<IpmiCmdData, CallBack>;
47
48} // namespace command
49} // namespace host
50} // namespace phosphor