Commit 1124b762 authored by Micha Müller's avatar Micha Müller
Browse files

Pusher: Caliper: Minor improvement to sensor management

parent d3e7b6d5
......@@ -125,6 +125,12 @@ void CaliperSensorGroup::read() {
}
return;
}
//Clear sensors from last connection. If their values have not been pushed
//by now they are lost.
acquireSensors();
_sensors.clear();
_baseSensors.clear();
releaseSensors();
}
const size_t bufSize = 2048;
......@@ -139,10 +145,10 @@ void CaliperSensorGroup::read() {
close(_connection);
_connection = -1;
LOG(debug) << _groupName << ": Connection closed";
acquireSensors();
_sensors.clear();
_baseSensors.clear();
releaseSensors();
//Clean up sensorIndex for the next connection. Keep actual sensors until
//a new connection is received so any possibly remaining sensor values can get
//pushed in the meantime.
_sensorIndex.clear();
return;
//nrec==-1 indicates an error during recv()
......
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