Enable OEM creation of non-Type1 SDRs

Enabling the dbus-sdrs feature is useful for managing Type 1 SDR's
using D-Bus. What doesn't work quite as well in the model is creating
non-Type 1 records. The current method works alright for Type 11 FRU
records. Any other SDR's beyond the FRU are problematic because the
code depends on manually defining custom 'if' clauses to compare the
incoming SDR ID, and determining what kind of SDR to create. It is a
fixed process that is inflexible, and assumes every BMC vendor wants
the same SDR arrangement.

This commit creates a model that allows the each OEM to customize
creating each SDR using their own algorithm. The OEM creates a
sensorcommands_oem.cpp/hpp file containing code for handling the
creation of custom SDRs. The code here is compiled and linked based on
enabling a Meson build switch.

The code follows the model that was already present in
dbus-sdr/sensorcommands.cpp. There are two functions that maintain the
original inflexible code, which is now expected to be primarily used
as a template for the OEM cpp/hpp contents.

Tested:
Created sensorcommands_oem.cpp/hpp files with OEM functionality
Enabled the original code, and compiled
Used ipmitool sdr dump sdrs.bin in the BMC Console
Confirmed the SDRs matched the values prior to this commit.
Enabled the OEM code and compiled
Used ipmitool sdr dump sdrs.bin in the BMC console
Confirmed the contents of the BIN file contained the SDRs generated by
the sensorcommands_oem.cpp source.

Change-Id: I100e747b52677be53b499713d51c6c1126411570
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/include/dbus-sdr/sensorcommands.hpp b/include/dbus-sdr/sensorcommands.hpp
index cde3ffb..df51f47 100644
--- a/include/dbus-sdr/sensorcommands.hpp
+++ b/include/dbus-sdr/sensorcommands.hpp
@@ -119,47 +119,13 @@
 namespace ipmi
 {
 
-SensorSubTree& getSensorTree()
-{
-    static SensorSubTree sensorTree;
-    return sensorTree;
-}
+uint16_t getNumberOfSensors();
 
-static ipmi_ret_t
-    getSensorConnection(ipmi::Context::ptr ctx, uint8_t sensnum,
-                        std::string& connection, std::string& path,
-                        std::vector<std::string>* interfaces = nullptr)
-{
-    auto& sensorTree = getSensorTree();
-    if (!getSensorSubtree(sensorTree) && sensorTree.empty())
-    {
-        return IPMI_CC_RESPONSE_ERROR;
-    }
+SensorSubTree& getSensorTree();
 
-    if (ctx == nullptr)
-    {
-        return IPMI_CC_RESPONSE_ERROR;
-    }
-
-    path = getPathFromSensorNumber((ctx->lun << 8) | sensnum);
-    if (path.empty())
-    {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
-    }
-
-    for (const auto& sensor : sensorTree)
-    {
-        if (path == sensor.first)
-        {
-            connection = sensor.second.begin()->first;
-            if (interfaces)
-                *interfaces = sensor.second.begin()->second;
-            break;
-        }
-    }
-
-    return 0;
-}
+ipmi_ret_t getSensorConnection(ipmi::Context::ptr ctx, uint8_t sensnum,
+                               std::string& connection, std::string& path,
+                               std::vector<std::string>* interfaces = nullptr);
 
 struct IPMIThresholds
 {
@@ -169,6 +135,31 @@
     std::optional<uint8_t> criticalHigh;
 };
 
+namespace sensor
+{
+/**
+ * @brief Retrieve the number of sensors that are not included in the list of
+ * sensors published via D-Bus
+ *
+ * @param[in]: ctx: the pointer to the D-Bus context
+ * @return: The number of additional sensors separate from those published
+ * dynamically on D-Bus
+ */
+size_t getOtherSensorsCount(ipmi::Context::ptr ctx);
+
+/**
+ * @brief Retrieve the record data for the sensors not published via D-Bus
+ *
+ * @param[in]: ctx: the pointer to the D-Bus context
+ * @param[in]: recordID: the integer index for the sensor to retrieve
+ * @param[out]: SDR data for the indexed sensor
+ * @return: 0: success
+ *          negative number: error condition
+ */
+int getOtherSensorsDataRecord(ipmi::Context::ptr ctx, uint16_t recordID,
+                              std::vector<uint8_t>& recordData);
+} // namespace sensor
+
 namespace dcmi
 {