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