Replace spaces in sensor name with underscores
Sensors don't have spaces in their names on D-Bus so if the user gives
us a name with spaces in it, convert them to underscores.
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
Change-Id: Ia6ad6de62a605a873f5bab40d1d3bf859c32c57b
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index 096845e..6dc4eb1 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -367,6 +367,7 @@
{
std::string sensorType = desc.value("SensorType", "");
std::string name = desc.value("Name", "");
+ std::replace(name.begin(), name.end(), ' ', '_');
if (!name.empty() && !sensorType.empty())
{