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