Add new type of settable interface - Polling

For use case of higher-level sensors we need a configuration option
to specify polling frequency and averaging period.

Example configuration entry might look like that:
{
    "Name": "Host CPU Utilization",
    "Polling": {
        "Interval": 1000,
        "AveragingPeriod": 3000
    },
    "Type": "HostCpuUtilization"
}

Both interval and averaging period could be user-defined.

This change also contains fix for what is probably a copy-paste
error. In case of nested object, settableInterfaces were queried
with wrong name. Instead of 'configuration type', the
'sensor type' was used. In case of arrays there were no such
error.

Testing:
- introduced new configuration type and verified under QEMU that
  proper configuration entry is exposed on D-Bus
- tried to write new values to configuration entry for nested
  configuration interface xyz.openbmc_project.Configuration.#NAME.Polling

Change-Id: I98bf41966e3948c1ae95e46ff232695ef852aefb
Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
diff --git a/configurations/WFT Baseboard.json b/configurations/WFT Baseboard.json
index 452fd8c..43280fb 100644
--- a/configurations/WFT Baseboard.json
+++ b/configurations/WFT Baseboard.json
@@ -528,6 +528,14 @@
             "Type": "ADC"
         },
         {
+            "Name": "Host CPU Utilization",
+            "Polling": {
+                "AveragingPeriod": 3000,
+                "Interval": 1000
+            },
+            "Type": "HostCpuUtilization"
+        },
+        {
             "Name": "1U System Fan connector 1",
             "Pwm": 0,
             "Status": "disabled",
diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp
index 3b2b416..ec38dde 100644
--- a/src/EntityManager.cpp
+++ b/src/EntityManager.cpp
@@ -75,8 +75,8 @@
                  {"FOUND", probe_type_codes::FOUND},
                  {"MATCH_ONE", probe_type_codes::MATCH_ONE}}};
 
-static constexpr std::array<const char*, 5> settableInterfaces = {
-    "FanProfile", "Pid", "Pid.Zone", "Stepwise", "Thresholds"};
+static constexpr std::array<const char*, 6> settableInterfaces = {
+    "FanProfile", "Pid", "Pid.Zone", "Stepwise", "Thresholds", "Polling"};
 using JsonVariantType =
     std::variant<std::vector<std::string>, std::vector<double>, std::string,
                  int64_t, uint64_t, double, int32_t, uint32_t, int16_t,
@@ -1096,9 +1096,10 @@
                                 "." + objectPair.key(),
                             boardKeyOrig);
 
-                    populateInterfaceFromJson(
-                        systemConfiguration, jsonPointerPath, objectIface,
-                        objectPair.value(), objServer, getPermission(itemType));
+                    populateInterfaceFromJson(systemConfiguration,
+                                              jsonPointerPath, objectIface,
+                                              objectPair.value(), objServer,
+                                              getPermission(objectPair.key()));
                 }
                 else if (objectPair.value().type() ==
                          nlohmann::json::value_t::array)