aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-05 16:24:40 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-09-05 16:25:51 +1200
commitf36b1eaf32af7ddc51daa558a6bb9e78095bb685 (patch)
tree7c0832d283071298acec358f231c6d366b5b69b8
parent2a49efdd97bb44c78afb27b00b57d14ed0f403ae (diff)
downloadtrackermap-server-f36b1eaf32af7ddc51daa558a6bb9e78095bb685.tar.gz
trackermap-server-f36b1eaf32af7ddc51daa558a6bb9e78095bb685.tar.bz2
trackermap-server-f36b1eaf32af7ddc51daa558a6bb9e78095bb685.zip
Fix GenX protocol issues
-rw-r--r--src/org/traccar/protocol/GenxProtocol.java4
-rw-r--r--src/org/traccar/protocol/GenxProtocolDecoder.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/GenxProtocol.java b/src/org/traccar/protocol/GenxProtocol.java
index deb89e4ae..2b5b1a43d 100644
--- a/src/org/traccar/protocol/GenxProtocol.java
+++ b/src/org/traccar/protocol/GenxProtocol.java
@@ -17,9 +17,9 @@ package org.traccar.protocol;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelPipeline;
+import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.traccar.BaseProtocol;
-import org.traccar.CharacterDelimiterFrameDecoder;
import org.traccar.TrackerServer;
import java.util.List;
@@ -35,7 +35,7 @@ public class GenxProtocol extends BaseProtocol {
serverList.add(new TrackerServer(new ServerBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
- pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\r'));
+ pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
pipeline.addLast("stringDecoder", new StringDecoder());
pipeline.addLast("objectDecoder", new GenxProtocolDecoder(GenxProtocol.this));
}
diff --git a/src/org/traccar/protocol/GenxProtocolDecoder.java b/src/org/traccar/protocol/GenxProtocolDecoder.java
index 6d16db9ad..1f9e5512c 100644
--- a/src/org/traccar/protocol/GenxProtocolDecoder.java
+++ b/src/org/traccar/protocol/GenxProtocolDecoder.java
@@ -69,7 +69,7 @@ public class GenxProtocolDecoder extends BaseProtocolDecoder {
}
}
- return position;
+ return position.getDeviceId() != 0 ? position : null;
}
}