aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/ServerManager.java8
-rw-r--r--src/org/traccar/protocol/Tr900ProtocolDecoder.java3
-rw-r--r--test/org/traccar/protocol/Tr900ProtocolDecoderTest.java2
3 files changed, 11 insertions, 2 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 44adfadbc..c175a332b 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -1288,6 +1288,14 @@ public class ServerManager {
pipeline.addLast("objectDecoder", new Tr900ProtocolDecoder(protocol));
}
});
+ serverList.add(new TrackerServer(new ConnectionlessBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("stringEncoder", new StringEncoder());
+ pipeline.addLast("objectDecoder", new Tr900ProtocolDecoder(protocol));
+ }
+ });
}
}
diff --git a/src/org/traccar/protocol/Tr900ProtocolDecoder.java b/src/org/traccar/protocol/Tr900ProtocolDecoder.java
index 8839f230b..e5674b262 100644
--- a/src/org/traccar/protocol/Tr900ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tr900ProtocolDecoder.java
@@ -21,6 +21,7 @@ import org.traccar.BaseProtocolDecoder;
import org.traccar.model.Event;
import org.traccar.model.Position;
+import java.net.SocketAddress;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.regex.Matcher;
@@ -56,7 +57,7 @@ public class Tr900ProtocolDecoder extends BaseProtocolDecoder {
@Override
protected Object decode(
- ChannelHandlerContext ctx, Channel channel, Object msg)
+ ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress, Object msg)
throws Exception {
String sentence = (String) msg;
diff --git a/test/org/traccar/protocol/Tr900ProtocolDecoderTest.java b/test/org/traccar/protocol/Tr900ProtocolDecoderTest.java
index a5ce90b15..5835a508b 100644
--- a/test/org/traccar/protocol/Tr900ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Tr900ProtocolDecoderTest.java
@@ -13,7 +13,7 @@ public class Tr900ProtocolDecoderTest extends ProtocolDecoderTest {
Tr900ProtocolDecoder decoder = new Tr900ProtocolDecoder(null);
- verify(decoder.decode(null, null,
+ verify(decoder.decode(null, null, null,
">12345678,1,1,070201,144111,W05829.2613,S3435.2313,,00,034,25,00,126-000,0,3,11111111*2d!"));
}