NVMeSensor: Centralise configuration type
The objectType populated in the Sensor instance was different to the
configuration name used by NVMeSensorMain, which lead to sensors not
being removed with their EntityManager configuration went away.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ifa3c8f41fa8367d8fae62fe0d9b63a2b1675b53f
diff --git a/src/NVMeSensorMain.cpp b/src/NVMeSensorMain.cpp
index e8fc21a..165cf2b 100644
--- a/src/NVMeSensorMain.cpp
+++ b/src/NVMeSensorMain.cpp
@@ -23,9 +23,6 @@
#include <optional>
#include <regex>
-static constexpr const char* sensorType =
- "xyz.openbmc_project.Configuration.NVME1000";
-
static NVMEMap nvmeDeviceMap;
static constexpr bool debug = false;
@@ -135,7 +132,7 @@
for (const auto& [interfacePath, sensorData] : sensorConfigurations)
{
// find base configuration
- auto sensorBase = sensorData.find(sensorType);
+ auto sensorBase = sensorData.find(NVMeSensor::CONFIG_TYPE);
if (sensorBase != sensorData.end())
{
const SensorBaseConfigMap& sensorConfig = sensorBase->second;
@@ -184,7 +181,7 @@
handleSensorConfigurations(io, objectServer, dbusConnection,
sensorConfigurations);
}));
- getter->getConfiguration(std::vector<std::string>{sensorType});
+ getter->getConfiguration(std::vector<std::string>{NVMeSensor::CONFIG_TYPE});
}
int main()
@@ -226,7 +223,7 @@
static_cast<sdbusplus::bus::bus&>(*systemBus),
"type='signal',member='PropertiesChanged',path_namespace='" +
std::string(inventoryPath) + "',arg0namespace='" +
- std::string(sensorType) + "'",
+ std::string(NVMeSensor::CONFIG_TYPE) + "'",
eventHandler);
setupManufacturingModeMatch(*systemBus);