nvmesensor: Use slave address from configuration json
Replace hardcoded slave address with address from the configuration
This patch is for non-compliant nvme devices (e.g.
configurations/nvme_p4000.json).
Tested: Manually by verifying the slave address in Entity Manager
configuration is used by the nvmesensor binary
Change-Id: I56b8187578c22a9be98ccd2c50a7b9838a087e52
Signed-off-by: Nnamdi Ajah <nnamdi@cloudflare.com>
diff --git a/src/NVMeSensor.hpp b/src/NVMeSensor.hpp
index dfed215..5d89d6a 100644
--- a/src/NVMeSensor.hpp
+++ b/src/NVMeSensor.hpp
@@ -13,7 +13,8 @@
std::shared_ptr<sdbusplus::asio::connection>& conn,
const std::string& sensorName,
std::vector<thresholds::Threshold>&& thresholds,
- const std::string& sensorConfiguration, int busNumber);
+ const std::string& sensorConfiguration, int busNumber,
+ uint8_t slaveAddr);
~NVMeSensor() override;
NVMeSensor& operator=(const NVMeSensor& other) = delete;
@@ -21,6 +22,7 @@
bool sample();
int bus;
+ uint8_t address;
private:
const unsigned int scanDelayTicks = 5 * 60;