functions: Replace IBMCompatibleSystem with Compatible

The Compatible interface will be replacing the IBMCompatibleSystem
interface. Reference:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/68125
https://gerrit.openbmc.org/c/openbmc/entity-manager/+/68128

Tested: Verified the symlinks for the PNOR files were created
successfully on a Rainier 4U system with the new Compatible interface
changes.

Change-Id: Idf2511d6616723bd21c945fe228499ae9eaf2fea
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/functions.cpp b/functions.cpp
index 24a099e..33b5611 100644
--- a/functions.cpp
+++ b/functions.cpp
@@ -84,26 +84,26 @@
 }
 
 /**
- * @brief Get file extensions for IBMCompatibleSystem
+ * @brief Get file extensions for Compatible
  *
- * IBM host firmware can be deployed as blobs (files) in a filesystem.  Host
+ * IBM host firmware can be deployed as blobs (files) in a filesystem. Host
  * firmware blobs for different values of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem are packaged with
- * different filename extensions.  getExtensionsForIbmCompatibleSystem
- * maintains the mapping from a given value of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem to an array of
- * filename extensions.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible are packaged with
+ * different filename extensions. getExtensionsForIbmCompatibleSystem maintains
+ * the mapping from a given value of
+ * xyz.openbmc_project.Inventory.Decorator.Compatible to an array of filename
+ * extensions.
  *
  * If a mapping is found getExtensionsForIbmCompatibleSystem returns true and
- * the extensions parameter is reset with the map entry.  If no mapping is
- * found getExtensionsForIbmCompatibleSystem returns false and extensions is
+ * the extensions parameter is reset with the map entry. If no mapping is found
+ * getExtensionsForIbmCompatibleSystem returns false and extensions is
  * unmodified.
  *
  * @param[in] extensionMap a map of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem to host firmware blob
- * file extensions.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible to host firmware blob file
+ * extensions.
  * @param[in] ibmCompatibleSystem The names property of an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem
+ * xyz.openbmc_project.Inventory.Decorator.Compatible
  * @param[out] extentions the host firmware blob file extensions
  * @return true if an entry was found, otherwise false
  */
@@ -165,9 +165,9 @@
  * @brief Find host firmware blob files that need well-known names
  *
  * The IBM host firmware runtime looks for data and/or additional code while
- * bootstraping in files with well-known names.  findLinks uses the provided
+ * bootstraping in files with well-known names. findLinks uses the provided
  * extensions argument to find host firmware blob files that require a
- * well-known name.  When a blob is found, issue the provided callback
+ * well-known name. When a blob is found, issue the provided callback
  * (typically a function that will write a symlink).
  *
  * @param[in] hostFirmwareDirectory The directory in which findLinks should
@@ -432,19 +432,18 @@
 
 /**
  * @brief Make callbacks on
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem instances.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible instances.
  *
- * Look for an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem in the provided
- * argument and if found, issue the provided callback.
+ * Look for an instance of xyz.openbmc_project.Inventory.Decorator.Compatible in
+ * the provided argument and if found, issue the provided callback.
  *
  * @param[in] interfacesAndProperties the interfaces in which to look for an
- * instance of xyz.openbmc_project.Configuration.IBMCompatibleSystem
+ * instance of xyz.openbmc_project.Inventory.Decorator.Compatible
  * @param[in] callback the user callback to make if
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem is found in
+ * xyz.openbmc_project.Inventory.Decorator.Compatible is found in
  * interfacesAndProperties
  * @return true if interfacesAndProperties contained an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem, false otherwise
+ * xyz.openbmc_project.Inventory.Decorator.Compatible, false otherwise
  */
 bool maybeCall(const std::map<std::string,
                               std::map<std::string,
@@ -455,20 +454,19 @@
     using namespace std::string_literals;
 
     static const auto interfaceName =
-        "xyz.openbmc_project.Configuration.IBMCompatibleSystem"s;
+        "xyz.openbmc_project.Inventory.Decorator.Compatible"s;
     auto interfaceIterator = interfacesAndProperties.find(interfaceName);
     if (interfaceIterator == interfacesAndProperties.cend())
     {
-        // IBMCompatibleSystem interface not found, so instruct the caller to
-        // keep waiting or try again later.
+        // Compatible interface not found, so instruct the caller to keep
+        // waiting or try again later.
         return false;
     }
     auto propertyIterator = interfaceIterator->second.find("Names"s);
     if (propertyIterator == interfaceIterator->second.cend())
     {
-        // The interface exists but the property doesn't.  This is a bug in the
-        // IBMCompatibleSystem implementation.  The caller should not try
-        // again.
+        // The interface exists but the property doesn't. This is a bug in the
+        // Compatible implementation. The caller should not try again.
         std::cerr << "Names property not implemented on " << interfaceName
                   << "\n";
         return true;
@@ -488,25 +486,23 @@
         }
     }
 
-    // IBMCompatibleSystem found and callback issued.
+    // Compatible found and callback issued.
     return true;
 }
 
 /**
  * @brief Make callbacks on
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem instances.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible instances.
  *
- * Look for an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem in the provided
- * argument and if found, issue the provided callback.
+ * Look for an instance ofxyz.openbmc_project.Inventory.Decorator.Compatible in
+ * the provided argument and if found, issue the provided callback.
  *
  * @param[in] message the DBus message in which to look for an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem
+ * xyz.openbmc_project.Inventory.Decorator.Compatible
  * @param[in] callback the user callback to make if
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem is found in
- * message
+ * xyz.openbmc_project.Inventory.Decorator.Compatible is found in message
  * @return true if message contained an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem, false otherwise
+ * xyz.openbmc_project.Inventory.Decorator.Compatible, false otherwise
  */
 bool maybeCallMessage(sdbusplus::message_t& message,
                       const MaybeCallCallbackType& callback)
@@ -523,17 +519,16 @@
  * @brief Determine system support for host firmware well-known names.
  *
  * Using the provided extensionMap and
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem, determine if
- * well-known names for host firmare blob files are necessary and if so, create
- * them.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible, determine if well-known
+ * names for host firmare blob files are necessary and if so, create them.
  *
  * @param[in] extensionMap a map of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem to host firmware blob
- * file extensions.
- * @param[in] hostFirmwareDirectory The directory in which findLinks should
- * look for host firmware blob files that need well-known names.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible to host firmware blob file
+ * extensions.
+ * @param[in] hostFirmwareDirectory The directory in which findLinks should look
+ * for host firmware blob files that need well-known names.
  * @param[in] ibmCompatibleSystem The names property of an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem
+ * xyz.openbmc_project.Inventory.Decorator.Compatible
  * @param[in] errorCallback A callback made in the event of filesystem errors.
  */
 void maybeMakeLinks(
@@ -554,15 +549,15 @@
  * @brief Determine system support for updating the bios attribute table.
  *
  * Using the provided extensionMap and
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem, determine if the bios
+ * xyz.openbmc_project.Inventory.Decorator.Compatible, determine if the bios
  * attribute table needs to be updated.
  *
  * @param[in] extensionMap a map of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem to host firmware blob
- * file extensions.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible to host firmware blob file
+ * extensions.
  * @param[in] elementsJsonFilePath The file path to the json file
  * @param[in] ibmCompatibleSystem The names property of an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem
+ * xyz.openbmc_project.Inventory.Decorator.Compatible
  */
 void maybeSetBiosAttr(
     const std::map<std::string, std::vector<std::string>>& extensionMap,
@@ -591,27 +586,26 @@
  * added signals from entity manager.
  *
  * Check the current entity manager object tree for a
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem instance (entity
- * manager will be dbus activated if it is not running).  If one is found,
- * determine if symlinks need to be created and create them.  Instruct the
- * program event loop to exit.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible instance (entity manager
+ * will be dbus activated if it is not running). If one is found, determine if
+ * symlinks need to be created and create them. Instruct the program event loop
+ * to exit.
  *
- * If no instance of xyz.openbmc_project.Configuration.IBMCompatibleSystem is
- * found return the callback context to main, where the program will sleep
- * until the callback is invoked one or more times and instructs the program
- * event loop to exit when
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem is added.
+ * If no instance of xyz.openbmc_project.Inventory.Decorator.Compatible is found
+ * return the callback context to main, where the program will sleep until the
+ * callback is invoked one or more times and instructs the program event loop to
+ * exit when xyz.openbmc_project.Inventory.Decorator.Compatible is added.
  *
  * @param[in] bus a DBus client connection
  * @param[in] extensionMap a map of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem to host firmware blob
- * file extensions.
+ * xyz.openbmc_project.Inventory.Decorator.Compatible to host firmware blob file
+ * extensions.
  * @param[in] hostFirmwareDirectory The directory in which processHostFirmware
  * should look for blob files.
  * @param[in] errorCallback A callback made in the event of filesystem errors.
  * @param[in] loop a program event loop
  * @return nullptr if an instance of
- * xyz.openbmc_project.Configuration.IBMCompatibleSystem is found, otherwise a
+ * xyz.openbmc_project.Inventory.Decorator.Compatible is found, otherwise a
  * pointer to an sdbusplus match object.
  */
 std::shared_ptr<void> processHostFirmware(
@@ -631,8 +625,8 @@
     auto pErrorCallback =
         std::make_shared<decltype(errorCallback)>(std::move(errorCallback));
 
-    // register for a callback in case the IBMCompatibleSystem interface has
-    // not yet been published by entity manager.
+    // register for a callback in case the Compatible interface has not yet been
+    // published by entity manager.
     auto interfacesAddedMatch = std::make_shared<sdbusplus::bus::match_t>(
         bus,
         sdbusplus::bus::match::rules::interfacesAdded() +
@@ -648,21 +642,19 @@
                       std::cref(*pErrorCallback));
 
         // if the InterfacesAdded message contains an an instance of
-        // xyz.openbmc_project.Configuration.IBMCompatibleSystem, check to
-        // see if links are necessary on this system and if so, create
-        // them.
+        // xyz.openbmc_project.Inventory.Decorator.Compatible, check to see if
+        // links are necessary on this system and if so, create them.
         if (maybeCallMessage(message, maybeMakeLinksWithArgsBound))
         {
-            // The IBMCompatibleSystem interface was found and the links
-            // were created if applicable.  Instruct the event loop /
-            // subcommand to exit.
+            // The Compatible interface was found and the links were created if
+            // applicable. Instruct the event loop / subcommand to exit.
             loop.exit(0);
         }
     });
 
     // now that we'll get a callback in the event of an InterfacesAdded signal
     // (potentially containing
-    // xyz.openbmc_project.Configuration.IBMCompatibleSystem), activate entity
+    // xyz.openbmc_project.Inventory.Decorator.Compatible), activate entity
     // manager if it isn't running and enumerate its objects
     auto getManagedObjects = bus.new_method_call(
         "xyz.openbmc_project.EntityManager", "/xyz/openbmc_project/inventory",
@@ -695,34 +687,33 @@
     {
         std::tie(std::ignore, interfacesAndProperties) = pair;
         // if interfacesAndProperties contains an an instance of
-        // xyz.openbmc_project.Configuration.IBMCompatibleSystem, check to see
-        // if links are necessary on this system and if so, create them
+        // xyz.openbmc_project.Inventory.Decorator.Compatible, check to see if
+        // links are necessary on this system and if so, create them
         if (maybeCall(interfacesAndProperties, maybeMakeLinksWithArgsBound))
         {
-            // The IBMCompatibleSystem interface is already on the bus and the
-            // links were created if applicable.  Instruct the event loop to
-            // exit.
+            // The Compatible interface is already on the bus and the links were
+            // created if applicable. Instruct the event loop to exit.
             loop.exit(0);
             // The match object isn't needed anymore, so destroy it on return.
             return nullptr;
         }
     }
 
-    // The IBMCompatibleSystem interface has not yet been published.  Move
-    // ownership of the match callback to the caller.
+    // The Compatible interface has not yet been published. Move ownership of
+    // the match callback to the caller.
     return interfacesAddedMatch;
 }
 
 /**
  * @brief Update the Bios Attribute Table
  *
- * If an instance of xyz.openbmc_project.Configuration.IBMCompatibleSystem is
+ * If an instance of xyz.openbmc_project.Inventory.Decorator.Compatible is
  * found, update the Bios Attribute Table with the appropriate host firmware
  * data.
  *
  * @param[in] bus - D-Bus client connection.
- * @param[in] extensionMap - Map of IBMCompatibleSystem names and host firmware
- *                           file extensions.
+ * @param[in] extensionMap - Map of Compatible names and host firmware file
+                             extensions.
  * @param[in] elementsJsonFilePath - The Path to the json file
  * @param[in] loop - Program event loop.
  * @return nullptr