-
Notifications
You must be signed in to change notification settings - Fork 76
/
host-interface.hpp
69 lines (62 loc) · 2.15 KB
/
host-interface.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include <host-cmd-manager.hpp>
#include <sdbusplus/bus.hpp>
#include <xyz/openbmc_project/Condition/HostFirmware/server.hpp>
#include <xyz/openbmc_project/Control/Host/server.hpp>
namespace phosphor
{
namespace host
{
namespace command
{
/** @class Host
* @brief OpenBMC control and condition host interface implementation.
* @details A concrete implementation for xyz.openbmc_project.Control.Host
* and xyz.openbmc_project.Condition.HostFirmware DBus API's.
*/
class Host :
public sdbusplus::server::object_t<
sdbusplus::server::xyz::openbmc_project::control::Host,
sdbusplus::server::xyz::openbmc_project::condition::HostFirmware>
{
public:
/** @brief Constructs Host Control and Condition Interfaces
*
* @param[in] bus - The Dbus bus object
* @param[in] objPath - The Dbus object path
*/
Host(sdbusplus::bus_t& bus, const char* objPath) :
sdbusplus::server::object_t<
sdbusplus::server::xyz::openbmc_project::control::Host,
sdbusplus::server::xyz::openbmc_project::condition::HostFirmware>(
bus, objPath),
bus(bus)
{
// Nothing to do
}
/** @brief Send input command to host
* Note that the command will be queued in a FIFO if
* other commands to the host have yet to be run
*
* @param[in] command - Input command to execute
*/
void execute(Command command) override;
/** @brief Override reads to CurrentFirmwareCondition */
FirmwareCondition currentFirmwareCondition() const override;
private:
/** @brief sdbusplus DBus bus connection. */
sdbusplus::bus_t& bus;
/** @brief Callback function to be invoked by command manager
*
* @detail Conveys the status of the last Host bound command.
* Depending on the status, a CommandComplete or
* CommandFailure signal would be sent
*
* @param[in] cmd - IPMI command and data sent to Host
* @param[in] status - Success or Failure
*/
void commandStatusHandler(IpmiCmdData cmd, bool status);
};
} // namespace command
} // namespace host
} // namespace phosphor