Commit 19aa31b8 authored by Eugenio Paolantonio's avatar Eugenio Paolantonio

[iioadaptor] Allow overriding iioDevices' scaling factor

Signed-off-by: Eugenio Paolantonio's avatarEugenio Paolantonio (g7) <me@medesimo.eu>
parent 61a9d7e8
......@@ -145,6 +145,14 @@ void IioAdaptor::setup()
iioDevice.channels = scanElementsEnable(devNodeNumber,1);
scanElementsEnable(devNodeNumber,0);
/* Override the scaling factor if asked */
bool ok;
double scale_override = SensorFrameworkConfig::configuration()->value(iioDevice.name + "/scale").toDouble(&ok);
if (ok) {
sensordLogD() << "Overriding scale to" << scale_override;
iioDevice.scale = scale_override;
}
introduceAvailableDataRange(DataRange(0, 65535, 1));
introduceAvailableInterval(DataRange(0, 586, 0));
setDefaultInterval(10);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment