aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-01-18 16:06:15 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-01-18 16:06:15 -0800
commit95ea36d99ff7686b36f1bfb11ec784d7a24e0205 (patch)
tree544acd170bf344989966b486691b960fd97e4bb6
parent24eac32a4a69cc7bbbfbe5c82464400ac0811684 (diff)
downloadtraccar-server-95ea36d99ff7686b36f1bfb11ec784d7a24e0205.tar.gz
traccar-server-95ea36d99ff7686b36f1bfb11ec784d7a24e0205.tar.bz2
traccar-server-95ea36d99ff7686b36f1bfb11ec784d7a24e0205.zip
Change protocol to UDP
-rw-r--r--src/org/traccar/protocol/NeosProtocol.java4
-rw-r--r--src/org/traccar/protocol/NeosProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/NeosProtocolDecoderTest.java2
3 files changed, 3 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/NeosProtocol.java b/src/org/traccar/protocol/NeosProtocol.java
index 61bdc6048..e545a9969 100644
--- a/src/org/traccar/protocol/NeosProtocol.java
+++ b/src/org/traccar/protocol/NeosProtocol.java
@@ -18,17 +18,15 @@ package org.traccar.protocol;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import org.traccar.BaseProtocol;
-import org.traccar.CharacterDelimiterFrameDecoder;
import org.traccar.PipelineBuilder;
import org.traccar.TrackerServer;
public class NeosProtocol extends BaseProtocol {
public NeosProtocol() {
- addServer(new TrackerServer(false, getName()) {
+ addServer(new TrackerServer(true, getName()) {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
- pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '!'));
pipeline.addLast(new StringEncoder());
pipeline.addLast(new StringDecoder());
pipeline.addLast(new NeosProtocolDecoder(NeosProtocol.this));
diff --git a/src/org/traccar/protocol/NeosProtocolDecoder.java b/src/org/traccar/protocol/NeosProtocolDecoder.java
index f5d28ba0c..f88f454a1 100644
--- a/src/org/traccar/protocol/NeosProtocolDecoder.java
+++ b/src/org/traccar/protocol/NeosProtocolDecoder.java
@@ -55,7 +55,7 @@ public class NeosProtocolDecoder extends BaseProtocolDecoder {
.number("d,")
.number("([01]{8})") // input
.text("*")
- .number("xx")
+ .number("xx!")
.compile();
@Override
diff --git a/test/org/traccar/protocol/NeosProtocolDecoderTest.java b/test/org/traccar/protocol/NeosProtocolDecoderTest.java
index 7d9588253..6bb939cc9 100644
--- a/test/org/traccar/protocol/NeosProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/NeosProtocolDecoderTest.java
@@ -11,7 +11,7 @@ public class NeosProtocolDecoderTest extends ProtocolTest {
NeosProtocolDecoder decoder = new NeosProtocolDecoder(null);
verifyPosition(decoder, text(
- ">12345678,1,1,070201,144111,W05829.2613,S3435.2313,,00,034,25,00,126-000,0,3,11111111*2d"));
+ ">12345678,1,1,070201,144111,W05829.2613,S3435.2313,,00,034,25,00,126-000,0,3,11111111*2d!"));
}