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