Move to common variant

This saves approximately 34kB in the compressed binary size of bmcweb
due to reduced template instantiations.  This amounts to a 2.5%
reduction in the overall size.

Note, there were a few places where we broke const-correctness in the
form of pulling a non-const reference out of a const variant.  This
new variant now requires const correctness, so some consts are
added where required.

Tested: Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6a60c8881c1268627eedb4ffddf16689dc5f6ed2
diff --git a/redfish-core/lib/led.hpp b/redfish-core/lib/led.hpp
index 1fdf5e7..c4a7ed8 100644
--- a/redfish-core/lib/led.hpp
+++ b/redfish-core/lib/led.hpp
@@ -21,8 +21,6 @@
 
 #include <app.hpp>
 
-#include <variant>
-
 namespace redfish
 {
 /**
@@ -39,7 +37,7 @@
     BMCWEB_LOG_DEBUG << "Get led groups";
     crow::connections::systemBus->async_method_call(
         [aResp](const boost::system::error_code ec,
-                const std::variant<bool> asserted) {
+                const dbus::utility::DbusVariantType asserted) {
             // Some systems may not have enclosure_identify_blink object so
             // proceed to get enclosure_identify state.
             if (!ec)
@@ -60,7 +58,7 @@
             }
             crow::connections::systemBus->async_method_call(
                 [aResp](const boost::system::error_code ec2,
-                        const std::variant<bool> asserted2) {
+                        const dbus::utility::DbusVariantType asserted2) {
                     if (!ec2)
                     {
                         const bool* ledOn = std::get_if<bool>(&asserted2);
@@ -151,13 +149,13 @@
                 "/xyz/openbmc_project/led/groups/enclosure_identify",
                 "org.freedesktop.DBus.Properties", "Set",
                 "xyz.openbmc_project.Led.Group", "Asserted",
-                std::variant<bool>(ledOn));
+                dbus::utility::DbusVariantType(ledOn));
         },
         "xyz.openbmc_project.LED.GroupManager",
         "/xyz/openbmc_project/led/groups/enclosure_identify_blink",
         "org.freedesktop.DBus.Properties", "Set",
         "xyz.openbmc_project.Led.Group", "Asserted",
-        std::variant<bool>(ledBlinkng));
+        dbus::utility::DbusVariantType(ledBlinkng));
 }
 
 /**
@@ -173,7 +171,7 @@
     BMCWEB_LOG_DEBUG << "Get LocationIndicatorActive";
     crow::connections::systemBus->async_method_call(
         [aResp](const boost::system::error_code ec,
-                const std::variant<bool> asserted) {
+                const dbus::utility::DbusVariantType asserted) {
             // Some systems may not have enclosure_identify_blink object so
             // proceed to get enclosure_identify state.
             if (!ec)
@@ -194,7 +192,7 @@
             }
             crow::connections::systemBus->async_method_call(
                 [aResp](const boost::system::error_code ec2,
-                        const std::variant<bool> asserted2) {
+                        const dbus::utility::DbusVariantType asserted2) {
                     if (!ec2)
                     {
                         const bool* ledOn = std::get_if<bool>(&asserted2);
@@ -264,13 +262,13 @@
                     "/xyz/openbmc_project/led/groups/enclosure_identify",
                     "org.freedesktop.DBus.Properties", "Set",
                     "xyz.openbmc_project.Led.Group", "Asserted",
-                    std::variant<bool>(ledState));
+                    dbus::utility::DbusVariantType(ledState));
             }
         },
         "xyz.openbmc_project.LED.GroupManager",
         "/xyz/openbmc_project/led/groups/enclosure_identify_blink",
         "org.freedesktop.DBus.Properties", "Set",
         "xyz.openbmc_project.Led.Group", "Asserted",
-        std::variant<bool>(ledState));
+        dbus::utility::DbusVariantType(ledState));
 }
 } // namespace redfish