diff --git a/src/se/hal/deamon/PCDataSynchronizationClient.java b/src/se/hal/deamon/PCDataSynchronizationClient.java index 8ada2ed3..cc0468eb 100755 --- a/src/se/hal/deamon/PCDataSynchronizationClient.java +++ b/src/se/hal/deamon/PCDataSynchronizationClient.java @@ -94,7 +94,7 @@ public class PCDataSynchronizationClient implements HalDaemon { out.writeObject(req); SensorDataListDTO dataList = (SensorDataListDTO) in.readObject(); - if(dataList.aggregationVersion != 0 && dataList.aggregationVersion != sensor.getAggregationVersion()){ + if(dataList.aggregationVersion != sensor.getAggregationVersion()){ logger.fine("The peer has modified its aggregated data in such a way that we need to reset the sync and start over on this side. oldAggregationVersion:"+sensor.getAggregationVersion()+" , newAggregationVersion:"+dataList.aggregationVersion); //clear old aggregated data for sensor diff --git a/src/se/hal/deamon/PCDataSynchronizationDaemon.java b/src/se/hal/deamon/PCDataSynchronizationDaemon.java index 1a7b38a5..e3c209c5 100755 --- a/src/se/hal/deamon/PCDataSynchronizationDaemon.java +++ b/src/se/hal/deamon/PCDataSynchronizationDaemon.java @@ -28,7 +28,7 @@ import java.util.logging.Logger; public class PCDataSynchronizationDaemon extends ThreadedTCPNetworkServer implements HalDaemon { private static final Logger logger = LogUtil.getLogger(); - public static final int PROTOCOL_VERSION = 3; + public static final int PROTOCOL_VERSION = 4; public PCDataSynchronizationDaemon() { @@ -102,7 +102,7 @@ public class PCDataSynchronizationDaemon extends ThreadedTCPNetworkServer implem PreparedStatement stmt = db.getPreparedStatement("SELECT * FROM sensor_data_aggr WHERE sensor_id == ? AND sequence_id > ?"); stmt.setLong(1, sensor.getId()); logger.fine("Client requesting sensor data: sensorId: " + req.sensorId + ", offset: " + req.offsetSequenceId + ", " + req.aggregationVersion); - if(req.aggregationVersion != 0 && req.aggregationVersion != sensor.getAggregationVersion()){ + if(req.aggregationVersion != sensor.getAggregationVersion()){ logger.fine("The requested aggregation version does not match the local version: " + sensor.getAggregationVersion() + ". Will re-send all aggregated data."); stmt.setLong(2, 0); //0 since we want to re-send all data to the peer }else{