host-condition: initial framework

This commit lays the groundwork for supporting the new
xyz.openbmc_project.Condition.HostFirmware interface and the
CurrentFirmwareCondition property within it.

The goal is for phosphor-host-ipmid to support both the existing (but
deprecated) Execute(Heartbeat) as well as the new
CurrentFirmwareCondition.

This new interface provides a more specific mechanism to check if the
host firmware is up and alive, allowing for other protocols (i.e. PLDM)
to also implement the interface easily.

The reasoning behind this change can be found in the PDI commit:
https://github.com/openbmc/phosphor-dbus-interfaces/commit/ec9fc42

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I39059c25a99f0c438748b6ad08e3bc936ba384ac
diff --git a/host-interface.hpp b/host-interface.hpp
index 5c95a66..056ffe9 100644
--- a/host-interface.hpp
+++ b/host-interface.hpp
@@ -2,6 +2,7 @@
 
 #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
 {
@@ -11,23 +12,26 @@
 {
 
 /** @class Host
- *  @brief OpenBMC control host interface implementation.
+ *  @brief OpenBMC control and condition host interface implementation.
  *  @details A concrete implementation for xyz.openbmc_project.Control.Host
- *  DBus API.
+ *  and xyz.openbmc_project.Condition.HostFirmware DBus API's.
  */
-class Host : public sdbusplus::server::object::object<
-                 sdbusplus::xyz::openbmc_project::Control::server::Host>
+class Host
+    : public sdbusplus::server::object::object<
+          sdbusplus::xyz::openbmc_project::Control::server::Host,
+          sdbusplus::xyz::openbmc_project::Condition::server::HostFirmware>
 {
   public:
-    /** @brief Constructs Host Control Interface
+    /** @brief Constructs Host Control and Condition Interfaces
      *
      *  @param[in] bus     - The Dbus bus object
      *  @param[in] objPath - The Dbus object path
      */
     Host(sdbusplus::bus::bus& bus, const char* objPath) :
         sdbusplus::server::object::object<
-            sdbusplus::xyz::openbmc_project::Control::server::Host>(bus,
-                                                                    objPath),
+            sdbusplus::xyz::openbmc_project::Control::server::Host,
+            sdbusplus::xyz::openbmc_project::Condition::server::HostFirmware>(
+            bus, objPath),
         bus(bus)
     {
         // Nothing to do
@@ -41,6 +45,9 @@
      */
     void execute(Command command) override;
 
+    /** @brief Override reads to CurrentFirmwareCondition */
+    FirmwareCondition currentFirmwareCondition() const override;
+
   private:
     /** @brief sdbusplus DBus bus connection. */
     sdbusplus::bus::bus& bus;