bmccontrolservices: Use service name for matching

The object paths of services are changed after service-config-manager
switched using sdbusplus to encode them, but now the service names can
be decoded from the object paths. This patch changes to use service
name for matching accordingly.

Also changes unorderded_map bmcServices to array as random access is
not needed here.

Requires service-config-manager change #52557 ("Encode object path with
sdbusplus") being merged first.

Tested:
Verified both Get/Set BMC Services IPMI commands work as before.

Change-Id: I6da7f275c252059b121c323280214012f330340f
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
diff --git a/src/bmccontrolservices.cpp b/src/bmccontrolservices.cpp
index 17c850a..b2b9610 100644
--- a/src/bmccontrolservices.cpp
+++ b/src/bmccontrolservices.cpp
@@ -32,15 +32,13 @@
 static constexpr uint8_t solServiceBitPos = 6;
 static constexpr uint8_t kvmServiceBitPos = 15;
 
-static const std::unordered_map<uint8_t, std::string> bmcServices = {
-    // {bit position for service, service object path}
-    {rmcpServiceBitPos,
-     "/xyz/openbmc_project/control/service/phosphor_2dipmi_2dnet"},
-    {webServiceBitPos, "/xyz/openbmc_project/control/service/bmcweb"},
-    {solServiceBitPos,
-     "/xyz/openbmc_project/control/service/obmc_2dconsole_2dssh"},
-    {kvmServiceBitPos, "/xyz/openbmc_project/control/service/start_2dipkvm"},
-};
+static constexpr std::array<std::pair<uint8_t, const char*>, 4> bmcServices = {{
+    // {bit position for service, service name}
+    {rmcpServiceBitPos, "phosphor-ipmi-net"},
+    {webServiceBitPos, "bmcweb"},
+    {solServiceBitPos, "obmc-console-ssh"},
+    {kvmServiceBitPos, "start-ipkvm"},
+}};
 
 static constexpr uint16_t maskBit15 = 0x8000;
 
@@ -140,7 +138,7 @@
             }
             for (const auto& obj : objectMap)
             {
-                if (boost::algorithm::starts_with(obj.first.str,
+                if (boost::algorithm::starts_with(obj.first.filename(),
                                                   services.second))
                 {
                     if (state != getEnabledValue(obj.second))
@@ -181,7 +179,7 @@
         {
             for (const auto& obj : objectMap)
             {
-                if (boost::algorithm::starts_with(obj.first.str,
+                if (boost::algorithm::starts_with(obj.first.filename(),
                                                   services.second))
                 {
                     serviceValue |= getEnabledValue(obj.second)